Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Switch Conditionals in Functions not working????
#1
Hey everbody

I am having a problem with a switch conditional which calls a function

The function is

Code:
char FUNC_RACE_GOOD();

it is declared in the switch conditional like this

Code:
case '1':  // Case for choosing the good alignment
    cout << "You have chosen to join the sides of good...\n\n";
    char FUNC_RACE_GOOD(); // Call the good race function
    
    break;

And end up here

Code:
char FUNC_RACE_GOOD() { // Function race good

    char RACE;

    cout << "----------------------------------\n";
    cout << "               Races\n";
    cout << "----------------------------------\n\n\n";
    cout << "1. Elf\n";
    cout << "2. Human\n";
    cout << "3. Dwarf\n";
    cout << "----------------------------------\n";
    cout << "Enter the corresponding digit for your race...\n\n";
    cout << "Race: \n";
    cin >> RACE;
// Not finished yet

but all it does it completely skip the whole function call and just ends the program

any help?
Reply


Messages In This Thread
Switch Conditionals in Functions not working???? - by Equinøx - 01-22-2010, 04:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best Functions for File Input/Output? Metapod 3 1,299 06-17-2011, 01:15 PM
Last Post: Mr. House
  Why are all the functions in programming languages English? nevets04 13 2,981 11-09-2009, 06:07 PM
Last Post: J4P4NM4N
  Hacker's test C functions g4143 4 1,323 11-03-2009, 09:11 PM
Last Post: g4143

Forum Jump:


Users browsing this thread: 4 Guest(s)