I have a nested structure which I am unable to access. Do I need to create an instance of the structure type tDate? I have no idea how to achieve that.
before Any ideas?
#include <iostream>
struct tPerson
{
struct tDate
{
int day;
int month;
int year;
};
char name[20];
char adresse[50];
char telefon[20];
int somethingelse;
};
int main(void)
{
//I am unable to access date this way
//tDate date = { day:10, month: 11, year: 1999};
tPerson person = {
name:"Firstname Lastname",
adresse:"Mainstreet 100, 1234 MyTown",
telefon:"0012345678"
};
return 0;
}
Now i remember having read somewhere that structures are classes with public access classifiers. This way you can access the internal parts of structure just like public elements of a class with class scope identifiers.
I have some code which makes use of this technique of nested structures very intensively.