//function that gets a message from the user and displays an error message if
//the message is greater than 27 characters
void getMessage(char data[CHARS])
{
printf("Please enter the message(MAX %d Chars) - ",CHARS);
gets(data); //get user input
while(strlen(data)>CHARS) //loop if string length is greater than 27
{
printf("Maximum is %d characters, please re-enter - ",CHARS);
gets(data); //get user input
};
}
//end getMessage function
if the number of charaters is below 27 everything works fine but as soon as i type more than 27 chars i need to re-enter another string, so i enter another string, when i try to exit the program i get an access violation error, does anyone have any ideas
thanx in advance