Functions are killing me
Hi can someone please look at this and tell how i can use a switch statement called print to work with my program. I think my problem is in the functions. all the functions work as the program is now but when i make a function called print and use a switch statement then i have problems. im still trying to learn to pass by value and its messing me up. hope you can help thanks!
I hope that the text file I downloaded is corrupt, and not identical to your source code. This can't be working, The <do> loop and the <switch> statement in the main function is not matched. The showMenu function does not return anything. Please check out the code and try again.
But just a guess: can it just be that the name <print> is already taken?
Pointers seem to be the biggest thing everyone has problems with-- think of it this way--
Passing by Value= contents of variable
Passing by Reference = address of variable
void foo1(char); /* prototypes */
myLetter = 'X';
foo1(myLetter); /* pass by value (contents of 'myLetter') */
foo2(&myLetter); /* pass by reference (refer to contents by passing address of 'myLetter') */
void foo1(char letter)
if(letter == 'X') /* look at value of 'letter' */
void foo2(char *letter)
if(*letter == 'X') /* go through 'letter' which is address of original variable to get to contents */