Questions tagged as 'struct'

1
answer

DLL library access made in Delphi from Java

I am developing a tool for biometric recognition using the SDK provided in DLL format, developed in Delphi. For DLL access from Java, I'm using JNA. The digital template (the most important part) is an object that refers to this section (in D...
asked by 06.03.2015 / 17:09
1
answer

How does C ++ padding work?

In several responses here in StackOverflow I have noticed users commenting on padding in data structures. struct { int a; char b; float d; } What is this padding (filler) that exists between the fields of a struct...
asked by 13.02.2015 / 13:29
5
answers

How to declare a date variable in C?

I need to create an abstract type of data that represents a person, including name, date of birth and CPF, and create a variable that is a pointer to this TAD (in the main program). To a certain extent I know, but I do not know which is the r...
asked by 04.05.2016 / 18:48
1
answer

What is the ":" (two points) used for in the declaration of a member of a structure?

I saw this: typedef struct { unsigned char a : 1; unsigned char b : 7; } Tipo; What does this statement mean? What is this 1 and 7?     
asked by 20.01.2017 / 13:24
1
answer

Why should a struct be at most 16 bytes?

I saw in a question about classes and structures that the latter should have a maximum of 16 bytes. Why do you have this limitation?     
asked by 08.05.2017 / 13:27
2
answers

Can I use class and struct at the same time?

I have a "Address" variable, however, it is made up of "Street", "Number" and so on. The way I did below is the best one to do? With class and struct at the same time? Or is there something better and simpler to do? public struct...
asked by 28.09.2016 / 15:49
1
answer

Start structure pointer with an address?

I would like to know if it is possible to start this pointer type structure with an address, without needing to point to another variable, or allocate memory. typedef struct{ char nome[20]; int idade; }pessoa; pessoa leonardo; pess...
asked by 28.09.2016 / 15:09
2
answers

strcpy is merging numeric format with other chars

I do not know if I could make myself understood in the title, but when I use strcpy() to copy a char* to another when I put a format so "teste" it works normally, but when I put a string format 3 letters (digits in case),...
asked by 02.06.2018 / 23:47
1
answer

How to put variables within vectors?

How do I create variables within a vector? Something like: int arr[] = {int x=1, int y = 2};     
asked by 17.12.2014 / 23:13
1
answer

Why can I access a structure other than the pointer?

When I declare a pointer to struct I can access members without putting the address of a struct , why is it possible? For example: struct exemplo{ int a ; }; int main() { struct exemplo *p; p->a = 10 ; }    ...
asked by 22.12.2015 / 22:24