i just started C and i'm doing a program for a class i'm taking and it requires the usage of a menu (i'm using a switch operator for this) and multiple functions in order to manipulate an image (i.e. load, save, make negative, flip...etc.) i'm having problems calling a function in the switch operator. i keep getting the error: syntax error before fuction...
any help is greatly appreciated!
this is what i have so far:
Code:
void PrintMenu();
/* read image from a file */
int ReadImage(char fname[SLEN], unsigned char R[WIDTH][HEIGHT], unsigned char G[WIDTH][HEIGHT],
unsigned char B[WIDTH][HEIGHT]);
/* save a processed image */
void SaveImage(char fname[SLEN], unsigned char R[WIDTH][HEIGHT], unsigned char G[WIDTH][HEIGHT],
unsigned char B[WIDTH][HEIGHT]);
/* begin function PrintMenu */
void PrintMenu()
{
int operator;
/* begin while loop */
while( operator != 11 ) /* program continues until input of 9 */
{
printf( "\n1: Load a PPM image" );
printf( "\n2: Save an image in JPEG format" );
printf( "\n3: Make a negative of an image" );
printf( "\n4: Flip an image horizontally" );
printf( "\n5: Flip an image vertically" );
printf( "\n6: Detect image edges" );
printf( "\n7: Add noise to an image" );
printf( "\n8: Image quantization" );
printf( "\n9: Add borders to an image" );
printf( "\n10: Image Overlay" );
printf( "\n11: Exit\n" );
printf( "\nEnter your choice:" );
scanf( "%d", &operator );
switch( operator )
{
case 1:
i get an error here, it says "syntax error before char"-->ReadImage(char fname[SLEN], unsigned char R[WIDTH][HEIGHT], unsigned char G[WIDTH][HEIGHT],
unsigned char B[WIDTH][HEIGHT]);
break;
case 2:
void SaveImage(char fname[SLEN], unsigned char R[WIDTH][HEIGHT], unsigned char G[WIDTH][HEIGHT],
unsigned char B[WIDTH][HEIGHT]);
break;
......and so on.
please tell me what i'm doing wrong.