Questions tagged as 'struct'

1
answer

What is and what is the structure sockaddr_in?

Lately I've been wanting to program a network sockets in C ++, but since the materials on the internet are a bit limited, I only show how to program the sockets without explaining in more detail the use of each function. I ended up getting lost...
asked by 26.09.2017 / 23:51
2
answers

How to transform my code with struct from static memory to dynamics in C?

The exercise asks me to read information in a file, being they, cpf, name, email and age of several people stored in a struct, sort in ascending order by age, if equal ages by cpf, and print in another file with the same format as it received, a...
asked by 13.09.2018 / 22:38
1
answer

Vector reading in C is wrong

struct cadastro{ int codigo; char nome[200]; char cpf[11]; char rg[10]; char tel[12]; char end[100]; }cadastro;//struct do tipo cadastro. struct cadastro cd[max];//vetor da funcao cadastro de cliente I have set up a menu, with do - while...
asked by 09.05.2016 / 00:08
3
answers

How to access a pointer inside a structure?

I need to know how to access the first position of the vector of pointers * c_parte_real, as shown below: typedef struct{ struct char_vector{ char *c_parte_real[2], *c_parte_imag[2]; }c_vector; struct int_vector{ int *i_...
asked by 19.12.2016 / 02:34
1
answer

struct array of characters

I'm having to remember programming in c ++ to teach a beginner class in programming logic. Subject this I have not seen for years. A struct was declared however when entering a string, the stream jumps to the next line. I looked for re...
asked by 26.10.2018 / 22:53
1
answer

C struct pointer

What happens is the following, inside the ins_ult() function I can change the value of root->data , but outside the function the value remains NULL . Am I passing the parameter wrongly or using malloc incorrectly?...
asked by 21.08.2014 / 02:28
1
answer

Help in struct C, failing to feed

Good morning, I'm creating this simple code, just to read, and display, this information of a vector, type struct . But when executing this code, at the time of execution, I can not feed the date or the membership, as it is explicit in...
asked by 10.07.2016 / 17:40
2
answers

free (): invalid next size (fast) when trying to free memory

I have this struct in a data structure and need to free the memory it uses: typedef struct { int capacityOfElements; //capacidade do vetor int numberOfElements; //número de elementos presentes no vetor int *data;...
asked by 03.12.2015 / 02:43
3
answers

Changing the size of the vector in a structure

I have the following structure: struct Implicantes{ int posicao; char binario[5]; bool dontcare; bool tick; struct Implicantes *Next; }; Is it possible to change the size of the vector of char "binary" from 5 to t...
asked by 24.07.2016 / 20:44
2
answers

How to change the way in which a class / structure is printed?

I have the following structure: struct cores { int r, g, b; public cores(int r, int g, int b) { this.r = r; this.g = g; this.b = b; } } If I have a new structure printed, it looks like this: Consol...
asked by 10.09.2017 / 03:05