Questions tagged as 'struct'

1
answer

How to manipulate a vector of structs in an external function? Follow example

I am doubtful in an issue. The following is the statement: Implement a library control system with functions to register, query, change, and remove books. The attributes of a book are: Name (Book title, with spaces) Author (Full name...
asked by 04.07.2017 / 22:59
1
answer

Vector of struct and pointer to char

Why this syntax is wrong: #include <stdio.h> typedef struct { char* nome; char* numero; }Agenda; void adiciona(Agenda* reg, int i) { scanf("%s", reg[i]->nome); scanf("%s", reg[i]->numero); } void imprime(Agenda*...
asked by 03.06.2017 / 00:22
1
answer

How to store calendar contacts I created in a vector \ array and list them? W

I'm trying to develop an agenda in C. I would like to know how do I store calendar contacts that I created in a vector \ array and list them? I'm also breaking my head when it comes to listing a phone number ... PLUS I would like tips to...
asked by 24.04.2017 / 16:19
1
answer

List operations (static) c ++

Good afternoon guys, I'm having trouble understanding operations on static lists, I know how to create and display, but how do I remove and search within the list, sort algorithms I've already understood some, can help me, please? I'm kind of des...
asked by 12.03.2017 / 20:57
1
answer

Struct defined in the .c auxiliary file (with definition of functions and structs) is not recognized in main

I'm doing a project in C, and I have 3 files: 1 .c containing the definitions of functions and structs. 1 .h containing the prototypes of these functions and structs ae1 .c that contains main. In the .c with the definitions, I define...
asked by 15.07.2016 / 17:05
1
answer

How to use pointer and vector in a single struct in C?

I can not run a program that needs functions to execute a procedure, this function receives a vector of type struct through a pointer. It does not have a compilation error, but the program crashes when it runs and does not work. How do I use all...
asked by 05.06.2016 / 02:32
1
answer

Help with nested structs in C

I was creating a list with C and using a struct , after finishing I tried to see what was changing with a nested struct , I created two structs basic, one getting only one value, and other receiving this first and a...
asked by 24.05.2016 / 06:34
1
answer

Error assigning value to struct property in C ++

I'm learning to program and, at the moment, trying to make a little game like the popular snake. There is a lack of incrementing of several things in the program, such as the limits of walls, collisions, etc ... So the following code is a sketch...
asked by 29.04.2016 / 05:07
1
answer

Pass C struct to moon script

When I have to pass my structure Book to the script in Lua , the method writes the value to nil .    How do I pass the Book structure to my moon code? main.c: #include <lua.h> #include <lualib.h> #incl...
asked by 18.04.2016 / 08:41
1
answer

Dynamic Allocation and Pointers on the Moon

I would like to know how to do dynamic allocation and pointer of a structure in Lua, I have the following statement in C that I need to pass to Lua; typedef struct ilha { char name; struct ilha *prox1, *prox2, *prox3; } *Ilha; Ilha al...
asked by 10.11.2015 / 14:08