   In need of help
  The C++ book I'm currently reading has taught a bit about functions and creating your own and calling on them. It gave me an exercise on calling them and then another one of calling the same funtion twice. I just can't figure out how to do it. Can someone help me? Here is the exercise I was supposed to do:Write a C++ program that uses three user-defined functions (counting main() as one) and produces the following output:Three blind miceThree blind miceSee how they runSee how they runOne function, called two times, should produce the first two lines, and the remaining function, also called twice, should produce the remaining output. [edited by - Hero on February 3, 2004 9:03:49 PM]
  Yeah simple. One function is calledvoid PrintMice(){   printf("Three blind mice\n");}Another function looks likevoid PrintHowTheyRun(){   printf("See how they run\n");}And inside yourint main(){   PrintMice();   PrintMice();   PrintHowTheyRun();   PrintHowTheyRun();}Or you can just use prototype of function and define it below, or include the function definition with the declaration up top as I have it.Phil P ;  you could also use this like functionvoid PrintMyText(int choice){if(choice == 1){cout << "Print mice";}if(choice == 2){cout << "the other thing";}int main(){PrintMyText(1);PrintMyText(1);PrintMyText(2);PrintMyText(2);return 0;}   Kevin ;void PrintText(short choice){    switch(choice)    {   case 1:   { printf("Three Blind Mice");   break;   }   case 2:   { printf("See how they run");   break;   }   default:  break;    }} ;  They asked him for three functions, so the first respondant is correct.However, if you''ve read the book far enough to get to the exercise and can''t do it... read it again. And if it''s not working, then maybe you''re not cut out for this stuff :/ 