Questions tagged as 'c'

1
answer

Stack Frame - Example

I am developing a program to simulate a Stack, however I have some difficulties in understanding the operation, can you correct this example? main(int y) { int j; f(j+1); } f(int x) { int i; return i+1; } I made this scheme, so w...
asked by 21.06.2014 / 13:41
1
answer

Error reading% f and% e of a file in C

In the following snippet of my code I have to read a function from a txt file and extract its coefficients. When I put the coefficients as integers and reading them with %d works correctly, but when putting the coefficients with floating...
asked by 10.07.2014 / 04:11
1
answer

Does gcov test code coverage during compilation or during execution?

I read about gcov for the first time in the Tor documentation , which says : '-' before a line means that the compiler generated no code for that line. '######' means that the line was never reached. Lines with numbers were called that numb...
asked by 27.03.2014 / 20:49
2
answers

Insert to end of list- efficient

typedef struct NODO{ int custo; int linha; int coluna; struct NODO *nseg[2]; }Nodo; Nodo * insertLastEfi(Nodo *L,Nodo *nv){ Nodo * aux =L; if (L==NULL) { return nv; } while (L->nseg[1]!=NULL) {...
asked by 04.01.2019 / 14:58
1
answer

Count period of a certain day with more vehicles

I'm doing a project on which it is based on creating a structure, a vector of a structure, filling that vector with data from a file and then performing some functions. One of the functions is to count the period of a certain day with more ve...
asked by 20.05.2014 / 02:05
1
answer

mysql connection error with c. Unknown type name 'SOCKET'

I have this code and it is generating an error. #include <stdio.h> #include <mysql.h> #include <windows.h> #include <sys\socket.h> void main(void) { //parâmetros para Conexão char host[100]; char user[100]...
asked by 31.05.2014 / 17:48
1
answer

Reading a file

I'm trying to read the contents of a file to a string, then use that same string in some operations. At this moment I have the following function (at this moment only reads and prints the content): char* ler_ficheiro(char* file_name){ int i...
asked by 05.01.2019 / 20:02
1
answer

Insert by order in list in C

I have the following function: Nodo * insertOrder(Nodo *L,Nodo *nv){ //11,1,50,7,5 if(L==NULL){ return nv; } if(nv->id < L->id){ return (insertFirst(L, nv)); } int c=0; Nodo *aux2=L; Nodo *aux=NULL; while(L!=...
asked by 05.01.2019 / 18:41
0
answers

sqlite error in the DevC ++

I'm having an error called "[Error] ld returned 1 exit status", I'm using DEVC ++ compiler, as soon as I put the SQLITE3.h include to start giving this error, the Code is taken from an example I found in this community. Please help me ... My...
asked by 19.12.2018 / 21:39
0
answers

Overlapping values in array

Hello I have an array that is formed by a set of random numbers. Yet some of these sets of numbers overlap. What can I do to prevent this from happening? void ransnipa(int (*board)[40]){ srand(time(NULL)); int k; int x[snipa];...
asked by 21.12.2018 / 18:50