I'm new to programming and this is my first year of C++.
All I've understood is that structures are variables with many different data types... I was wondering if it is like a container of data types. Or is it just data? Or both?
For example :
struct data {
int data_type_integer;
string data_type_string;
char data_type_char;
float data_type_float;
} variable1;
So in this case, the variable (variable1) contains 4 data types: (int, string, char, float)
But what if we have 2 of the same data types? like :
struct data {
string data_type_string
string data_type_string2
};
In this case, the struct has 2 of the same data type in a single variable; How is it possible?
The variable struct variable is a customized data type variable or a container of many variables that become data for the variable?
Thanks. (I keep asking me this question and I can not find results online and sorry for my bad English.)