-
Calling A Funtion
Can anyone see whats wrong with the following code its not running the displaymenu function its going striahgt over it I think
Code:
#include <stdio.h>
int displaymenu ();
int main ()
{
puts("BeforeMenu");
displaymenu;
puts("AfterMenu");
return (0);
}
int displaymenu ()
{
puts ("\n\tP System");
puts ("\n\n\t1) Add Entry");
puts ("\n\t2) Delete Entry");
puts ("\n\t3) Find Entry");
puts ("\n\t4) View List");
puts ("\n\t5) Sort Entries");
puts ("\n\n\ttQ) Quit");
puts ("\n\n\t Enter Selection");
return(0);
-
Code:
puts("BeforeMenu");
displaymenu();
puts("AfterMenu");
return (0);
-
What does it do when I just call displaymenu? Is displaymenu a pointer and displayermenu() a function call then?
-
where did the last go in desplaymenu ?
-
Thanks I understand now, are there situations when you want to call a function by its pointer then? GCC wasnt giving me any warnings.