Hi Guys
Im struggling to figure out how to make this work. im trying to make this little program that repeats lines of text you type unless it exceeds 9 characters in which case it lets you know
The line of code for the while loop is completely wrong i know but i left it there so you could hopefully at least see what i was striving for
ill put the code in here. if anyone has any idea how i need to write it so it works id be grateful
Code:
#include <stdio.h>
#include <stdlib.h>
#define MAX 9
int main ()
{
char *input;
input = malloc(9);
while (gets(input) < MAX)
{
printf("\nYou typed %s", input);
}
printf("\nToo many letters you Entered!");
return 0;
}