Questions tagged as 'struct'

1
answer

When I try to make a .bin file it gives a multiple-definition error in all functions

Linux I use the following command lines to run all the files: gcc -c aluno.c // gera o arquivo objeto com extensão .o de mesmo nome gcc -c teste.c gcc -o prog.bin teste.o aluno.o //para criar o arquivo prog.bin com a junção dos arquivos alun...
asked by 04.11.2016 / 21:22
1
answer

fread and structure memory allocation

I have the following structure: typedef struct registro {//52 bytes char codigo[4]; char descricao[31]; char unidade[3]; int quantidade; float valor; char status; }registro; It should store the values of a dados...
asked by 31.10.2016 / 01:37
1
answer

Problem with search with Struct

In my code, I can insert and delete normally, but in searches it does not print, what could be the problem? I thought it would work the way I did. Am I doing 'if' correctly? struct fichacarro { char fabricante[15]; char modelo[15]; char combu...
asked by 01.10.2016 / 19:44
1
answer

error: invalid use of undefined type 'Row struct'

I am implementing a queue to control the threads created, in C . So while the thread is not the first in the queue it waits to be terminated. example: // // Enquanto não é primeira da fila // while(idd != PPFila.dados[PPFil...
asked by 27.07.2016 / 13:15
1
answer

Two-dimensional array size within the struct in C

Hello. I'm doing a job that I read a txt (the file name is passed by argv []) and it generates a graph. In the first line of the file two parameters are passed as follows: GO These parameters are integers and have a meaning: V = number of vertic...
asked by 20.03.2016 / 17:29
1
answer

How do you assign data to a struct by reading from a CSV file?

I am having difficulty assigning read values from a file in csv format to one struct, my file has the following structure: 1;República Checa;156.9 2;Irlanda;131.1 3;Alemanha;115.8 4;Austrália;109.9 5;Áustria;108.3 And my code looks like thi...
asked by 23.04.2016 / 05:52
1
answer

How do I define the push_back function for a c ++ structure?

How can I use the push_back function in a structure? I have the Arc structure: 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) {} };...
asked by 23.08.2015 / 00:09
1
answer

Printing problem with C

Good morning. I have a problem solving a question of an issue here in college. Here's the question. Theteachergavethesourcecode(following)#include<stdio.h>#include<stdlib.h>#include<locale.h>#definedimencao10typedefstructce...
asked by 31.08.2015 / 16:24
2
answers

File manipulation

Hello. I have a problem with handling create and manipulate a file in C. First I made the whole code using a struct and functions, it worked everything right. I put the commands to create the file and it is also ok. My problem is when you ope...
asked by 20.06.2015 / 22:07
2
answers

Problems with vectors and structs

I'm a beginner in C ++ (even because the code is basic) and I'm having a problem with an exercise that needs to save the data of 10 people (name, date of birth and height) using structs. The structs are: typedef struct { char nome[50];...
asked by 29.07.2014 / 21:43