Questions tagged as 'struct'

2
answers

Problem with Struct in C

In this code: #include <stdio.h> #include <stdlib.h> //Usando o struct(Estruturas) struct cadastro { char nome[50]; int idade; char rua[50]; int numero; }; int main() { printf("Digite suas informacaoes...
asked by 18.05.2015 / 02:45
1
answer

Struct presenting problem

I am not able to compile the program has error in the declaration of the variable struct product, when I try to create an instance in main . #include <iostream> using namespace std; struct produto; int main() { produ...
asked by 12.09.2017 / 01:15
1
answer

Referencing struct within another in C

I need to have a reference of struct within the other. But in the example below as struct TAnimal does not yet exist, its reference to struct player of error. How to get around this situation? typedef struct jogador{...
asked by 18.03.2017 / 13:18
1
answer

How to make a query in C language?

Good evening, I'm making a project of writing files in binaries in a txt and then reading those files. But I have to read the file or list all. How could I do a search for the required file? And one more question what is feof? List the last give...
asked by 03.12.2016 / 03:40
2
answers

Conflict types in function

I'm trying to create a list structure using struct . But when I compile my code, I get an error because, even specifying Lista , it has a problem. Follow the complete code: #include <stdio.h> #include <conio.h> s...
asked by 16.08.2016 / 19:52
1
answer

Size of struct allocation

When I declare a normal variable of type int for example, the compiler goes there and, depending on the architecture, separates 4 bytes . struct exemplo{ int x; int b; }; int main(){ struct exemplo exemplo; } When I declare...
asked by 12.04.2015 / 04:36
1
answer

I can not call a string

I've created an algorithm that simulates a stock of a DVD sale. It stores name, price, and quantity. It has some functions and enters them, one that informs the quantity and the price of a specific dvd and it is in that I am having problems....
asked by 14.05.2015 / 20:37
1
answer

Pointer to struct within a struct

I can not assign value to a variable of a pointer of struct within a struct . My structs : typedef struct notas{ float geral; float especifica; }Notas; typedef struct data{ int dia,mes,ano; }Data; typedef st...
asked by 25.11.2014 / 20:14
2
answers

Declaration of a global array of structures in C

I created a cliente structure and the next idea would be to create an array clientes . My idea would be to declare the array clientes globally, so that all functions can interact without being passed as an input parameter...
asked by 21.12.2018 / 22:04
1
answer

Function that returns pointer crashes when it tries to return pointer to main program

I have this function that retrieves a record of a binary file already filled with records - such records are structured as node - and returns it to the program. However, in the return from "i" to the main program variable "test", the two being...
asked by 12.12.2014 / 15:45