Questions tagged as 'struct'

1
answer

Struct with JSON in C ++

I'm having problems inflating a struct using a JSON file, in fact I do not know how to do this, I've been searching the JsonCpp library, but I was not successful. Here's a simple example of my code: #include <iostream> using namespac...
asked by 08.12.2018 / 23:25
0
answers

Save variable in struct by pointer

I have a problem with my code that I can not solve, I think it's a simple detail, but I have not found it yet. I need to pass by reference a vector, which has a struct, but it is not allocating the data in the struct and the program closes....
asked by 27.11.2018 / 21:01
1
answer

Problems accessing struct members [closed]

I have to do some functions with these structs, but since Agenda has a vector of structs Contact and in each contact has another struct Data, how do I access the fields? Do I have to work each struct separately? Thanks in advance, follow the cod...
asked by 26.11.2018 / 18:47
1
answer

How to sort array structures based on song rank?

The rank of the code is going in increasing order but the others do not change the positions along with the rank, how do I position the songs and styles to go along with the code? #include <stdio.h> #include <locale.h> struct musi...
asked by 08.11.2017 / 23:56
0
answers

Saving the data in an array skips the next question

I have the following code: #include <stdio.h> #include <stdlib.h> #include <locale.h> struct cadastro_palestra { char nome[50]; char cpf[13]; char email[70]; }; int main () { setlocale(LC_ALL, "Portuguese");...
asked by 08.11.2018 / 11:39
0
answers

Store Struct data in a Vector

I'm trying to store data from a struct into a vector, except that I register 2 products to test, and when I call the show function in main it only shows the last product registered as if it had only read the last data inserted and replaced , but...
asked by 18.10.2018 / 15:17
1
answer

Problem with struct: "Expected expression before"

The following problem    expected expression before 'eqp' in the line of the function 'data' where the value is read and I could not identify the reason for it. #include <stdio.h> #include <stdlib.h> #include <locale.h>...
asked by 19.09.2018 / 20:13
1
answer

Quicksort C - contest.c: 16:50: error: request for member 'name' in something not a structure or union

I'm trying to make this URI issue:    Tetris       Your high school class decided to organize a tetris championship.   After discussion of the rules, it was defined that each student would play   a total of 12 matches. From the 12 scores obt...
asked by 21.08.2018 / 04:23
0
answers

How do I pass the values stored in a struck to another function can I modify it?

I've been trying to run this program since yesterday, but I can not manipulate the data of my struct when I move it to another function, the other function simply to create other values, the goal of the program is to change the name cpf and enro...
asked by 22.06.2018 / 21:52
0
answers

Error in list of structures in C

I'm working on a structure list code, where I have a struct called cad that contains the registration, name, and salary fields. And a list containing a field of type struct cad that stores the fields of the struct cad in list form. So the code l...
asked by 09.06.2018 / 19:22