Questions tagged as 'c'

1
answer

Dynamic array as a parameter in C or C ++?

After hours of research, I did not find anything that answered my question, or I could not understand the answer. I want to create a NxN array of variable size. I did with pointers , but I want to pass it as a parameter between functions, a fu...
asked by 25.03.2018 / 06:51
1
answer

How do I create a sum () function for arduino? W

Angles ang = {0.0,46,0,91,2,134,7,179.2} were measured, the unit is deg (steps). I have to implement code that initializes the values as a global array, and then sets the void function sumCum (float arr []) {} which calculates cumulative sums (S...
asked by 09.01.2018 / 19:08
1
answer

Error counting values repeated in a vector

I'm trying to make an issue count the number of times that each value appears in the vector, which I tried, just count a number repeated, could someone help me with logic, Example of input 8 10 8 260 4 10 10 Output 4 appears 1 time (s) 8 appe...
asked by 25.04.2018 / 15:45
1
answer

Apply color palette to raw image

I have an image in gray levels and I want an algorithm to apply a color palette to it. Does anyone have reference to an algorithm technique used or something of the sort? I am not experienced with digital image processing. If there are any C or...
asked by 26.01.2018 / 13:18
1
answer

Error reading values for a dynamically allocated array

Good afternoon, I'm doing some code to study more about memory allocation in C with the malloc function, and I was developing a code to allocate an array and then read values and save it, but it is giving error while executing and closing the...
asked by 11.12.2017 / 20:33
1
answer

histogram of a c ++ sentence

I made the following program to make the histogram of a sentence counting the number of letters and consonants in the same one but it is giving error because I'm trying to get it to print uppercase and lowercase letters accented or not .. #inc...
asked by 09.12.2017 / 15:25
1
answer

How to allocate a dynamic, user-supplied stack?

I want to allocate a dynamic stack with the size provided by the user, then treat it as a "vector" would be more or less what I did in the function ALOCA ? #include <stdio.h> #include <stdlib.h> #include <ctype.h> #incl...
asked by 10.12.2017 / 15:23
1
answer

C pointers handled in python

#include <stdio.h> #include <stdlib.h> #include <locale.h> int main() { setlocale(LC_ALL,""); int *x,valor,y; valor = 35; x = &valor; y = *x; printf("o endereço da variavel valor: %p\n", &valor...
asked by 09.01.2018 / 19:04
1
answer

Error with test cases

My teacher recommended this site called uri, and I am able to solve some questions, but in that I tried all the solutions that the question put and the program I did comes out the results requested in the question, the uri judge is giving 30% of...
asked by 14.01.2018 / 21:26
1
answer

Makefile returning error "Missing Separator"

I'm trying to run a makefile that compiles programs in 'C'. TARGET=client server CC= gcc CFLAGS= -Wall -Wextra -g LDFLAGS = -lm -pthread -lncurses DEPS = util.h normal: $(TARGET) client: client.c $(CC) $(CFLAGS) client.c -o client $(LD...
asked by 15.01.2018 / 14:00