toupper works but tolower doesn't?

Hey guys! I was doing pretty well until I came upon this. Everything works but my program from convert upper to lower case letters. What am I missing?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  #include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
	void convert(char[]);// function protocol, Declaring all variables
	char first[90];
	char middle[50];
	char last[70];
	int length=0;
	
	printf("Enter first name:\n");//entering in first name
	gets(first);
	convert(first);
	
		printf("Enter middle name:\n");
		gets(middle);
		convert(middle);
			
			printf("Enter last name:\n");
 			gets(last);
 			convert(last);
 
 
 	strcat(first," ");//adding them all to string first
		strcat(first,middle);
	strcat(first," ");//Used to space out the name.
		strcat(first,last);
	length=strlen(first); //Length of string including all spaces.
		printf("The string %s has %d characters.",first,length); //Displays name capitalized and spaced out including length of the string.

	return 0;	
	
}	//end of main

void convert(char names[])
{//function header; converts the firt letter to upper case and all other characters to lower case.

	int length;
		length=strlen(names);
	int i;
		names[0]=toupper(names[0]);
	for(i=1;i<length;i++);
		names[i]=tolower(names[i]);
	 
}// end of loop 
Remove the semicolon at the end of line 43. As coded the loop does this:
1
2
3
	for(i=1;i<length;i++)
               ;
        names[i]=tolower(names[i]);

Remove the semicolon at the end of line 43. As coded the loop does this:
1
2
3
	for(i=1;i<length;i++)
               ;
        names[i]=tolower(names[i]);


I think his intention was to put the line 44 within the loop.
there are names for people like you Hayden. They're called saviors. Thank you!
Topic archived. No new replies allowed.