Hi guys,
I'm new to the forum so nice to meet you all
I've started programming in C not long ago and had an assignment to write a creative program implementing sturctures.
well, I've started writing it and then came across this problem:
Code:
#include <stdio.h>
struct Personal_Details
{
char name[20];
char nickName[10];
int age;
int kills; //the amount of men he killed
};
struct Consigliere //adviser to the boss
{
Personal_Details PD;
int relationship_boss; //How close is the consigliere to the boss from 1 to 10 (10-as close as he'll ever get without being killed).
Boss boss;
};
struct Boss
{
Personal_Details PD;
Consigliere consigliere;
};
struct Soldier
{
Personal_Details PD;
Capo related_capo;
int promotion; //How close to promotion (1- No way ever- too stupid. 10- The boss already knows his name)
Associate associates[15];
};
struct Capo
{
Personal_Details PD;
int loyalty; //(1- already providing information to the cops. 10- will give his life for the familia(the mafia))
Soldier soldiers[7];
};
struct Under_Boss
{
Personal_Details PD;
int potential; //Potential of being a smart and fearsome boss from 1 to 10 (10- Very talented, half the soldiers already look to him as the actual boss).
int ambitious; //(10- Probably already plotting how to take down the boss)
Boss boss;
static Capo capos[5];
};
struct Associate{
Personal_Details PD;
Soldier related_soldier;
int joining_the_familia;//How close to join the familia(1- Only a tool, probably will be killed this year. 10-The underboss already knows his name)
};
struct Sicilian_Mafia // "Try to be as creative as you can"
{
char state_of_control[15];
Boss boss;
Consigliere consigliere;
Under_Boss underBoss;
};
void main(){
Sicilian_Mafia maf;
};
I've been trying to replace the sturctures one before the other but it wouldn't help, it always happens that a sturcture needs a structure that haven't been defined yet.
What shall I do?
Thanks!