Well the program takes a string of text and then turns it into title case (first letter or every word is capitalized). So I got it working as you see, the problem is I need to write a seperate function that can simply accept the string to be converted as an argument, and convert the string in place. I am not so good at the whole function thing so... any help would be great. As a note... I am 100% lost on this.
#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main()
{
char text[255] ;
int i, first = 1;
printf(" Enter String: ");
fgets( text, 255, stdin );
for ( i = 0; text[i] != '\0'; ++i )
{
if ( first )
{
text[i] = toupper(text[i]);
first = 0;
}
if ( isspace(text[i]) )
{
first = 1;
}
}
puts( text );
return 0;
}