Questions tagged as 'struct'

0
answers

How can I read a CSV file with different line types?

I'm trying to read a CSV file that has different rows. I'm using fgets and strtok to save to a list. the problem is that being different rows I do not know how to stop and move on to the next one. typedef struct{ int id_viagem; int duracao; in...
asked by 25.05.2017 / 00:18
0
answers

struct that stores number of rows and columns of array and a vector

I used a struct to store the number of rows (m) and columns (n) of the array and another to store number of columns of the vector (n). I make the product of two arrays in the function prod() and the product of a matrix with a vecto...
asked by 25.05.2017 / 23:49
1
answer

product of arrays using struct

I used struct to store the number of rows and columns in the array. I make the product of two matrices and the product of a matrix with a vector, but the output is always 0. I do not know how to change the code so that it does what I want, I bel...
asked by 25.05.2017 / 23:05
1
answer

Double-chained Lists Removal Doubt (C / Orderly Insertion)

In a C ++ class the teacher had proposed an activity where I had to do a program in the form of a double-chained list with ordered insertion. However, I have a problem in the Removal part. When removing all members from either end to the other...
asked by 12.05.2017 / 23:24
0
answers

Pass vector of type struct as parameter of a function in C

I need to create a function that is in a .h file that generates random numbers n (user-defined and passed by parameter in function), and fill the set b with the generated values. tConj.cpp file TConj a,b,c,d; int elemento, i,op; lon...
asked by 10.04.2017 / 22:11
1
answer

Read from a txt file using fscanf using vector

I have the following while(!feof(f)){ (*ptr).push_back(carro()); fscanf (f, "%d", (*ptr)[add].id); fscanf (f, "%s", (*ptr)[add].marca); add++; } Where * ptr is & vector, a vector of a struct car, I have alrea...
asked by 16.03.2017 / 21:24
1
answer

Error passing a structure by reference in C [closed]

I'm learning C. However, I had a problem passing a structure to a function. I can not figure out what the error is. I will be grateful if anyone helps me. Me Sorry for the bad documentation. However, the code is very simple. #include<std...
asked by 26.01.2017 / 07:45
1
answer

Run-time error in C [closed]

Well, it's compiling everything ok, however, when I'm going to print the elements of the entire array tab [8] [8], which is a member of the lady structure, the compiler is somehow assigning numbers to this array, the which I do not know where th...
asked by 29.01.2017 / 08:38
1
answer

How to increment the index of an unlimited array?

How can I increment an array within a structure? My structure is this: struct list { char name[50]; int products_list[]; } LIST[10]; I wanted to know the current number of elements in the array (list_products) to add more products with t...
asked by 01.01.2017 / 23:03
0
answers

Insert calls with priority in a row using nested struct

Personal speech !!! All beauty? I made another code that is showing the result and I can also dequeue and insert the values removed from this main queue into a secondary structure according to the priority. Oops, I advanced a bit. hehehe....
asked by 07.11.2016 / 00:29