Newbie- having trouble with functions

This is a discussion on Newbie- having trouble with functions within the C Programming forums, part of the General Programming Boards category; Can anyone help a rookie new to C who is working hard to figure out and get comfortable with functions?? ...

Newbie- having trouble with functions

Can anyone help a rookie new to C who is working hard to figure out and get comfortable with functions?? Below is my code for a program that is to prompt user for input to draw a shape by invoking the corresponding function. Right now I cannot get it to compile. I am getting an error "C:\Documents and Settings\Owner\My Documents\project2.c(70) : error C2143: syntax error : missing ';' before 'type' " [reference line is: int circle (int shape) ].
Could someone please take a look at my code? I am still working to understand functions and even all the concepts of C. I have not been able to locate the source of the error and am also afraid even if I can that I may have used incorrect data types, called the functions incorrectly, etc. Any and all suggestions and assistance would be appreciated. Thanks,

Segmentation Fault: I am an error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers, attempts to access a non-existent or read-only physical memory address, re-use of memory if freed within the same scope, de-referencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.

The above is wrong. The origional poster should go read the FAQ on the topic, and never use it again. Also, you really should learn how to pay attention to your compiler's warning and error messages. They're there for a reason. If they're not there, turn them on.

on the note of fflush(stdin).... I was reading my book "SAMS: Teach yourself C in 21 Days" only to discover that the writer uses it all the time!!

That really surprised me, no wonder so many use it incorrectly.

They will tell you to use feof() to control a loop, as well as give plenty of examples of global variables (not that global variables are evil, but in many of the examples they were not necessary). There could be other little things there too, but I can't remember...