Questions tagged as 'struct'

1
answer

password confirmation on c

I need to register N people in my program with only two information: name and password. After the user enters a name, if this name is not registered the program displays a non-registration message and closes, but if it is registered it asks the...
asked by 10.04.2017 / 05:36
1
answer

request for member 'attributeDisplay' in something not a structure or union

Tree initialization error, the problem with category variables and atributoOuDecisao . typedef struct node { int categoria; int atributoOuDecisao; struct node *prox; struct node *lista; } No; No *criaArvore(void){ No...
asked by 16.10.2016 / 20:12
1
answer

Dynamic allocation with struct

/* [Error] expected primary-expression before'*' token [Error] 'dia' was not declared in this scope [Error] 'mes' was not declared in this scope [Error] 'ano' was not declared in this scope */ You are giving these compiler errors....
asked by 04.05.2016 / 17:41
2
answers

Use pointer to struct

I wanted to know how to access a certain element of a struct in the way I'm defining it. Here is my struct: typedef struct { char *produtos[200000]; int contador; } Produtos,*ProdutosP; I set ProdutosP p as a pointer to the struc...
asked by 20.03.2016 / 19:08
1
answer

Pass values to a struct

Good afternoon. I am in doubt if it is possible to pass values to a struct in C using JSON, hibernate or some other known method?     
asked by 01.03.2016 / 20:00
1
answer

Stream corrupts when being saved

I have the algorithm that simulates a type of register, but when I save the file the fields, street, city and state are lost, they simply disappear, and as I am saving it it corrupts the file already at the time of writing. I can not figure out...
asked by 26.11.2014 / 04:55
2
answers

Compile error in C ++ when accessing structure in function

I am creating a code that stores the information of 3 people within a struct , but I am having a compile error when I save the age option in struct . The error is this: /home/arthur/Área de Trabalho/pj/pj.cpp: In function ‘void cadast...
asked by 02.11.2018 / 15:52
1
answer

How to resolve error in printing strings?

I'm passing a struct by reference to a function at the time of inserting the data, and again at the time of printing this data. But the "insert_element" function does not read the time float (it skips the reading), and the function "Print_dates"...
asked by 07.11.2018 / 12:15
1
answer

My struct type is not recognized within my class

People, I'm doing the implementation of a stack with pointers in C ++ and I have the following code for now: template <class T> struct Node { T item; Node *prox; }; class Pilha { private: int tamanho; Node *topo;...
asked by 24.09.2018 / 01:39
1
answer

Assigning values to an array of struct in Golang

I'm starting to learn go and need to fill popular the different structs with their values. I thought about creating an array of structs and trying to use a for to fill in the fields but a invalid operation: p[1].burst[i] (type int does not sup...
asked by 31.10.2018 / 22:39