Questions tagged as 'c'

0
answers

My code stops working after it runs integer

I'm scheduling an exercise for my college and I have to do a String Matching code in KMP, until then I did the whole code, I tested some entries, when I went to test the teacher's inputs I heard an error, when I looked through the debug of my co...
asked by 05.07.2017 / 09:33
2
answers

Pass array to functions in C

Good night, next I have a problem when passing an array to a function in C. I have the following code void funcao(int mat[][num]); int main() { scanf(%d,&num); } It is basically the following, I define the size of the array in the ma...
asked by 21.06.2017 / 01:19
2
answers

What is the difference between assigning and comparing string variables with function or with assignment and comparison operator?

I came across the following questions: What is the difference between the expressions strcpy (s, t) e s = t ? What is the difference between the expressions if (strcmp (s, t) < 0) e if (s < t)  ? I tried to compile...
asked by 11.08.2015 / 00:44
0
answers

Remove even elements from a simply linked list

I'm making a function to remove ALL pairs from a list that is simply chained, but when I run the system, only one element is removed each time I call the function. Ex: Elements = {2, 4, 5, 3}, if I call the function, it deletes element 4, and af...
asked by 16.06.2017 / 01:50
1
answer

Compare integer and pointer

Well, I have a question, I'm trying to copy a line to a file but I get an error that says I can not compare an integer with a pointer, can anyone help me? The error is in line ch = getc(file1); and while(ch != EOF) #include <s...
asked by 14.06.2017 / 21:00
2
answers

How to read string with space in a repeat structure?

I have to do a program to read the name, author and price of a quantity n of books (from structures). I made a struct for the books this way: typedef struct{ char nome[100]; char autor[100]; float preco; }dadoslivros; and create...
asked by 14.06.2017 / 23:07
1
answer

Breakpoint in function SearchAppleApaga (Binary trees)

Good, I have an error in the SearchArvoreApaga function, when I try to delete a value from the binary tree nothing happens and if I try to delete the root of the tree I get the following breakpoint: Exception thrown: read access violation....
asked by 26.06.2017 / 18:16
2
answers

code implementation

I and a colleague are newcomers to programming and we are building a game where we need to use threaded list. He was responsible for creating a game menu using threaded list and I for creating the game. So now we need to merge the codes and it t...
asked by 13.06.2017 / 01:55
1
answer

Vectors or Arrays in C / C ++ [closed]

I have a question about how to do item 1 in the menu, if anyone can explain me, I would appreciate it a lot :) Faculty X thought of adopting lockers for students to leave their materials in the same way as American universities. With that, sh...
asked by 10.06.2017 / 02:16
1
answer

How to store the distinct elements that occur in another vector?

In the vector below 300 elements, I need to store the distinct elements that occur in another vector called values. Since then I have to register how many times the i-th value of the vector values occurs in the first vector. I started to do the...
asked by 04.07.2017 / 13:27