I am trying to write a program that when you input a line of text it converts it to uppercase and then lowercase. I can convert it to uppercase no problem using a while statement (required) however it doesn't move on the next while statement. Like it doesn't set the pointer back to the text that is input.
Any help?
Code:
printf ("\nEnter a line of text:\n");
gets(text_ptr);
printf ("\nThe line of text in uppercase is:\n");
while (*text_ptr != '\0')
putchar ( toupper (*text_ptr++) ); /* post-increment */
printf ("\n");
printf ("\nThe line of text in lowercase is:\n");
while (*text_ptr != '\0')
putchar ( tolower (*text_ptr++) ); /* post-increment */