Questions tagged as 'struct'

1
answer

How to pass the field of a struct to a function in a part library?

Hello, everyone. I have a program that has a struct like this: struct itemDeLista{ char nomeProd[10]; float quant; float vUnit; int item; }; But I need to count the number of letters in the str...
asked by 19.08.2016 / 04:11
1
answer

Language C: Manipulating a vector of structs within functions

Hello, I created a struct : typedef struct { float valor; float peso; } objeto; And inside main () I created a vector of these guys: objeto conjunto[50]; Here, I need to exchange a 'place' object with...
asked by 09.06.2016 / 17:04
1
answer

Error importing structs from a header file

I need to use the following structures without changing their implementations from a .h file. typedef unsigned long int chave_t; typedef unsigned long int conteudo_t; typedef struct entrada_hash{ chave_t chave; conteudo_t * con...
asked by 10.04.2016 / 18:37
1
answer

Clone a struct without copying the memory address

I need to copy struct problema1 to struct problema2 , but when doing the way you are in the program below, when I change the struct problema2 , you are also changing the struct problema1 . The way I did it by copying the...
asked by 08.07.2016 / 18:08
1
answer

Problem with reading Bitmaps in C

I'm having trouble reading Bitmap files. The results are not expected. Size is always the same regardless of which image I open The height and width do not match the size stated in the image viewer Color values are not always the...
asked by 04.04.2016 / 23:23
2
answers

Physically delete a struct type record

I need to physically delete a record created within a struct defined in my program, but in every way I tried (Set it to NULL , Create another struct and save all records that were not deleted in it ). I registered the foll...
asked by 29.08.2015 / 15:30
3
answers

Read a string with line break

I need to compare two strings to see if they are the same. One of them is in a struct vector and has been dealt with fgets , so it is broken. The other is informed by the keyboard. I would like to know if there is any function to read t...
asked by 07.12.2014 / 23:11
1
answer

Help: Valuing a char array of a struct within an if

I'm trying to set the value of a char vector of a struct inside an if, but without success ... A struct itself: struct ficha { char nome[31], classificacao[31], telefone[21]; float altura, peso, imc; }paciente1, pa...
asked by 15.07.2014 / 23:36
0
answers

Nested Struct - Difficulty in understanding the concept

I have the following structures: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } List; I made a dra...
asked by 08.12.2018 / 01:03
1
answer

Doubt - Dynamic List

I have the following structure for my dynamic list: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } Li...
asked by 11.12.2018 / 02:04