0

i need to write a function that will take these family codes and convert them into names, as shown below. i'm at a loss as to what to do. i'm thinking i need to do some kind of case thing.
case 0 = drake;
break;
case 1 = spencer.

i don't know if that would even work, but as i said, i'm completely lost on how to do this. if anyone could give me some tip or hint, it would be very much appreciated.


string familyName( int familyCode )

This function will find a family name.

This function takes as its arguments a family code. It returns the name of the family that corresponds with the integer code.

Family Code Family Name
0 Drake
1 Spencer
2 Morgan
3 Corinthos
4 Webber
5 Quartermaine
6 Davis

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by WaltP
0

Look up exactly how the switch()/case statement works.
Look up how string type works when passing/returning using functions.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.