The problem I have is how to do a switch where I have to call the certain choices.

int main(void)
{
do 
{
   cout << "Hello there ." << endl;
   cout << "Select from the menu." << endl; 
   cout << "A gets lyrics." << endl; 
   cout << "B gets artist." << endl; 
   cout << "Q quits the program." << endl;
   cout << "Your choice: --> " << endl;
   cin  >>  user_choice; 

switch (user_choice)
{
 case 'A': lyrics 
 break; 
 case 'B': artists
 break; 
}

Recommended Answers

All 2 Replies

what are lyrics and artists? are they functions?
if yes, you should call them by lyrics() and artists()

switch (user_choice)
{
case 'A': lyrics() 
break;
case 'B': artists()
break;
}

ScienceNerd, please use code tags, it helps make the cod readable.

Dave

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.