Questions tagged as 'struct'

1
answer

Struct with union is giving invalid use error

I need to use union within struct , but I can not. The error displayed is    [Error] invalid use of 'union Client :: document' Struct: struct Cliente{ string nome, email; union documento{ long cpf...
asked by 18.11.2018 / 14:18
1
answer

How do I store data in a struct and then use it in different functions?

I'm trying to schedule this work for days and I can not get out of the corner, it's a library system that needs to be: a) Register, view, change, and remove data from a book; b) Register, view, change and remove new clients; c) Make a ne...
asked by 22.06.2018 / 17:25
1
answer

How to remove a struct stored in file in c?

I do not think I explained well in the title I have a calendar code where I can add contact, edit, list and get stored in an agenda.txt file I'm just having trouble removing a contact that was previously added Code: #include <stdli...
asked by 07.06.2018 / 17:32
0
answers

(c) Sort Matrix of Structs

Good to all! I have a problem that I can not solve and I seek help from members. In my code, I read the contents of a file and save it in a string for use in the code, in the main loop, I get this string and refer to the function call BreakSt...
asked by 01.07.2018 / 18:43
1
answer

dynamic reallocation - struct array

I need to do an exercise in which the code allocates memory as needed, but I need to relocate an array of structs, but I ended up locking in that part. My Struct is: typedef struct{ char nome[100]; char endereco[100]; int numero...
asked by 23.05.2018 / 00:01
0
answers

What is the bubble short error in this code?

   I tried to solve this problem of Online Judge URI and I got to this   code, and it works for test cases smaller than the problem, and   I already looked for the error, but I can not find it.   Code:#include<stdio.h>#include<stdl...
asked by 09.04.2018 / 05:06
0
answers

C code only compiles once and then closes

I have a code that I am writing in C, and then a problem is constantly happening. I do not know if it has anything to do with memory allocation. I have a function: struct elementodos interpretar(char* element){ struct elementodos separ...
asked by 13.12.2017 / 17:45
2
answers

assignment to expression with array type

I'm having an error while associating an array address in a pointer to struct, I'm getting an error of type:    assignment to expression with array type The code I'm using is this: struct MaxHeap { int size; int* array; }; stru...
asked by 14.10.2017 / 16:17
1
answer

Checking for code matching in a vector within a struct in C

Next, I've created a struct struct eventos { int codigo; char data[11]; char atracao[50]; int ingresso; float valoring; }; And so, I created a vector that way struct eventos ficha[5]; My goal is to check inside a f...
asked by 24.09.2017 / 21:33
1
answer

Problem in orderly insertion of structs into records

I'm doing a job where I have to insert structs in alphabetical order into files, where the structs are political and the files (which together form a linked list) are the parties. I'm having a hard time figuring out how to insert politicians in...
asked by 11.06.2017 / 04:51