For the error mentioned in your question - you have no main()
function, and you don't have a complete C program until you write one. Your linker is looking for it, and giving you an error when it can't find it.
There's plenty of other errors here, too, including:
printf("/n1 - $5.00");
- it's\n
, not/n
, and it's not clear why you're putting the newline at the beginning of the line, instead of the end:printf("/nN – Nuts $1.40"); printf("Enter your delicious selection here: ",*selection);
is going to give you some weird looking text, for instance.Talking of which,
printf("Enter your delicious selection here: ",*selection);
- you provide achar
as an argument toprintf()
, but according to your format string, it's not expecting any arguments. Should beprintf("Enter your delicious selection here: ");
Since you're not terminating it with a newline, you should also add anfflush(stdout);
before your call toscanf()
.scanf(" %c", &*selection);
- why dereference a pointer only to take its address again? There are some good reasons not to, including the fact that it amounts to taking the address of a temporary value which is illegal. You already have a pointer, so use it - should bescanf(" %c", selection);
if(selection=='P'||'p')
- binary logical operators don't work like that in C, should beif ( selection == 'P' || selection == 'p' )
.scanf(" %c", &*payment);
- same issue with as point 3 above, plus herepayment
is adouble *
, and you're tellingscanf()
to read achar
. Should bescanf("%lf", payment);
void Menu(char *selection);
at the bottom - as pointed out in the comments to your main question, this is a function declaration, not a function call, and effectively does nothing here. Should beMenu(again)
, although really it should just return true or false, and the caller should decide whether or not to callMenu()
again.
Several of these errors are repeated in various places throughout your code, I haven't listed every single example. This passing around of pointers is just really weird design, too. All of your functions are declared as returning void
- if you changed them to return a value and employed some local variables, instead, you'd be able to avoid passing any pointers at all.