Hello! I have the following problem> I have this 3 structures:

struct student 
{
   char name;
   int index;
};

struct modul
{
   char mod_name[10];
   struct student st[10];
};

struct faculty 
{
   char fax_name[20];
   struct modul mod[3];
}prom;

------------------
My question: How can i reach the name of the student that is part of a given modul, and goes to given faculty, by using pointer?
Should i make a pointer for prom and then use the '->' sign to get to the name of the student?
Thanks in advance

well if you want a pointer then i believe the syntax would be

faculty * foo = new facilty;
foo->mod[0].st[0].name;

also please you code tags

well if you want a pointer then i believe the syntax would be

faculty * foo = new facilty;
foo->mod[0].st[0].name;

also please you code tags

yup, thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.