Questions tagged as 'struct'

1
answer

Linked List - append and push

I'm trying to learn Linked List and made the following code: #include <iostream> using namespace std; typedef struct snode { int data; snode *next; } node; void start(node ** head) { (*head)->next = NULL; } void push(...
asked by 12.07.2017 / 02:43
1
answer

Binary file storage

In the program, I need to implement a structure that represents a student (name, age, and enrollment). Using this structure, I have to write a program that reads the data of 5 students and stores them in a binary file. Implemented the structu...
asked by 22.06.2017 / 19:58
1
answer

Why does this error occur? - invalid application of 'sizeof' to incomplete type

When I try to compile (gcc test.c) it generates the following error: Thecode:#include<stdio.h>#include<stdlib.h>#include<string.h>typedefstructalunoAluno;intmain(){Aluno*a;a=malloc(sizeof(Aluno));//Inseredadosnoscamposdotip...
asked by 04.11.2016 / 18:42
1
answer

List of structs

I would like to know the benefit of using a list in this way. typedef struct Pessoas { char nome[20]; int idade; struct Pessoas *prox; }pessoas; typedef struct Funcionario { pessoas *pessoa; struct Funcionario *prox; }fun...
asked by 07.12.2016 / 03:59
1
answer

Printing a vector ... Differences between C ++ and C ... Where did I go wrong?

I have problems in vector printing of structs in C, in C ++ it worked ... First I will show the C version with problems (in the execution since it compiles without errors) CACHE cache = createCache(descricao); //chamada da main printaCache...
asked by 18.11.2016 / 05:08
1
answer

Structure of the Commit

I would like to know if you can change the structure of a commit, in the case before it is made a predetermined structure, example: GIT_AUTHOR_NAME = '$name(Previamente registrado)' GIT_AUTHOR_DATE = '$date(data do sistema)' GIT_COMMITTER_DATE...
asked by 30.06.2016 / 17:00
1
answer

Assigning / Printing values to void * in a structure

#include <stdio.h> typedef struct elem{ void * d; }Elem; main(){ Elem *p; Elem e; double pi = 3.14; e.d = &pi; p->d = &pi; printf("%f\n",p->d); printf("%f\n",e.d); } When I do the...
asked by 28.01.2016 / 20:40
1
answer

Faster way to add an item to an array, use a structure

Structure turma Public id_turma As Integer Public nome_turma As String End Structure Structure Disciplina Public id_disciplinas As Integer Public nome_disciplina As Integer End Structure Public Class F_Contentor Dim turmas()...
asked by 22.02.2016 / 18:08
1
answer

Define an array and the type of a function in C

Hello, I'm developing a C language initialization project, namely creating a Multimedia Management System that will have to be able to manage a database of record items like CDs, DVDs and Vinyl Records. > At the moment, after declaring the...
asked by 02.03.2016 / 14:32
1
answer

Wrap strings using struct

I'm doing a basic exercise using the struct module, and I came across a problem: To wrap a string , we should enter in the struct.pack() method the number of characters it has, right? But what if this string is informe...
asked by 05.07.2015 / 05:36