Questions tagged as 'struct'

2
answers

Doubt in Struct + C pointer

Given the code below, I wonder why the second printF of the LeAluno procedure does not print correctly? #define MAX 3 typedef struct aluno{ int matricula; float notas[2]; } Aluno ; int t=1; void LeAluno(Aluno *Param){// com ponteiro...
asked by 29.07.2014 / 20:01
1
answer

Why when I include my .h header, is the .c implementation not included too?

I have three files, produtos.h , produtos.c and main.c . produtos.h is located in the "headers" folder, produtos.c is located in "sources" and main.c is in the same folder as "headers" and "sources", some...
asked by 08.10.2018 / 17:23
1
answer

Sort linked list in C

My problem involves reading data from a text file, where the CPF is provided, name, email, age, order save using list sort in ascending order through age, if you have the same age sort by cpf. But I'm having trouble sorting the linked list, so f...
asked by 18.09.2018 / 03:28
1
answer

How to create binary tree with iterative algorithm?

I'm making a program that allocates a dictionary in memory to check misspelled words in text files. The function below converts dictionary words to integers and stores them in tree structures. My question is how to write correctly and ite...
asked by 10.12.2017 / 00:22
1
answer

How do I resolve struct declaration warning?

I'll send the code and warnings that GCC is reporting. Should I ignore the warnings? warnings are related as passing from struct to function Inserir(); : #include <stdio.h> #include <stdlib.h> int menu(); int...
asked by 21.09.2017 / 17:01
3
answers

How to dynamically increase the struct size?

How can I increase the size of the struct when the current size is reached? #define TAM_MAX 50; typedef struct{ char nome[TAM_NOME]; /* nao pode ser vazio*/ char sobrenome[TAM_SOBRENOME]; char telefone[3][TAM_FONE]; /* mo...
asked by 06.11.2016 / 17:31
2
answers

Struct or Classes?

I made the code using structure, wanted to know if classes would be more efficient. I'm doing it in C ++ Builder. The idea of the code is as follows: create a list of problems, where during the execution of the code will be added and removed num...
asked by 30.07.2016 / 03:14
2
answers

How to declare in the function a component of a static struct? W

In the .h file: struct conectores { int entrada[n]; int busca[n]; } conect; struct connectors; void cadastra_entrada(FILE *fp, int cont, struct conectores conect, int entrada[n]); Function: void cadastra_entrada(FILE *f...
asked by 02.12.2015 / 13:36
1
answer

Conversion of struct with struct nested to record

I have a small "constraint" on a project I'm working on. We received a DLL written in C so we could communicate with readers of that company.  Attached, came an example written in Borland C ++ 6, which works correctly. The problem is to use this...
asked by 01.07.2014 / 02:12
1
answer

Error printing member of struct: request for member in something not a structure or union

I have the following struct : typedef struct{ int Numerador ; int Denominador ; } TNumeroRacional ; In this function I ask the user to enter 2 numerators and denominators to form 2 rational numbers. void Atribuir (TNumeroRac...
asked by 02.09.2018 / 00:04