Questions tagged as 'struct'

1
answer

How to pass, by reference, a vector of structures to a function?

I'm having a hard time understanding the passing by reference of a vector of structures. There is no running error, but I'm not sure if I'm reading the file right there. #include <stdio.h> #include <stdlib.h> #includ...
asked by 23.05.2018 / 16:00
1
answer

how to pass two structs by function

I have two structs, one for student data and one for a hash table, where the collisions of the matriculas go. To know if there was a precise collision between these two structs, but the dev says there are some errors when I try to pass the two f...
asked by 16.05.2018 / 02:02
0
answers

How to detect the end of reading a file in a loop with while in C ++

In my code, you have the struct: struct material { int idmaterial; double rho; double precokg; }; And the reading function of a data vector of type "material", from a file: std::vector<material> le_material(std::string s...
asked by 14.05.2018 / 19:36
0
answers

Passing Struct to a class by reference

Good afternoon, guys. I'm learning how to program in C ++ and I use the Qt framework for it. I get an error compiling as below:    ../ RWCXML / frmMainWindow.cpp: In member function 'void clsMainWindow :: fcMontarDadosXml ()':   ../RWCXML/...
asked by 09.05.2018 / 21:42
0
answers

FIFO with STRUCT does not work

Good evening, ten days ago I posted this question: How to create FILA passing a STRUCT with community support I've created this code: #define TAM 5 #include <stdio.h> #include <string.h> #include <stdlib.h> #include <lo...
asked by 28.04.2018 / 23:59
0
answers

How to create FILA by passing a STRUCT

I'm trying to create a code in which I'll enter 10 candidate names in a queue using a C structure. But I do not have much knowledge in C data structure. I did this: #define TAM 5 #include <stdio.h> #include <string.h> #include...
asked by 18.04.2018 / 18:43
1
answer

passing a struct using extern C in a .dll c ++

I have a function that comes from a .lib that returns me a struct tabela GSTV(vector<double> inpA, vector<double> inpB); This struct is defined as follows: struct tabela { vector<int> Z; vector<double> F;...
asked by 03.04.2018 / 02:57
1
answer

Accessing the allocation causes the program to stop working

I have a problem accessing a struct of subscribers typedef struct Inscrito { char nome[50]; float cadastro; float nota; }; Inscrito *inscritos = NULL; It is a global variable and every time I access it in some way (either to...
asked by 07.04.2018 / 21:20
1
answer

How to mount the operator == of a struct?

I have the following structs: struct Arco { int i, j; Arco () {}; Arco (const Arco& obj): i(obj.i), j(obj.j) {}; Arco(int _i, int _j) : i(_i), j(_j) {} }; struct ARCO_TEMPO { Arco a; int slotTimeU; int slotTimeV; A...
asked by 07.04.2018 / 23:12
0
answers

List and Pointers in C

I'm trying to create a static list, and I can not display the product name in the printf("\n Indice: %d Valor: %s",i,p->nomeProduto[i].valor); list, only the "ListList", the query function probably does not work. Here is the whole c...
asked by 05.03.2018 / 18:52