Help on program regarding uppercase/lowercase

Hello, I'm working on a program that is supposed to: Convert uppercase characters to lowercase, and lowercase to uppercase. The program should display the characters changed and end when a period is entered after the characters.

Here is what I want my output to look like:
Enter some characters: TestCharactersforProgram
Looks like you've finished your sentence.

Here are your changed characters: tESTcHARACTERSFORpROGRAM
The amount of letters changed was: 24

Press any key to continue...


I basically am aiming for a program that reads characters, then converts uppercase to lowercase, and lowercase to uppercase. Then display the changes that occurred (for example in the output above it would be 24 changes occurred).

Here is the code so far:
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
/* The ASCII lowercase letters are separated from the uppercase letters 
by 32. Thus, to convert a lowercase letter to uppercase, subtract 32 from
it. 

Use this information to write a program that reads characters from 
the keyboard. 

Have it convert all lowercase letters to uppercase, and 
all uppercase letters to lowercase, displaying the result. Make no 
changes to any other character.

Have the program stop when the user 
enters a period. At the end, have the program display the number of case 
changes that have taken place.
*/


#include <iostream>
#include <string>
using namespace std;

int main()
{
	char characters;
	int pcount;
	
		
	cout << "Type some characters in:  ";
	cin >> characters;
{
	for(characters; characters <= 100; characters - 32)
		cout << "  " << characters;
}

	if(pcount = 1)
		if(characters>=1)
	{
		cout << "Looks like you've finished your sentence...\n\n";
		cout << "There were " << characters << "Changes in the characters.";
		cout << "\n\n";
	}
	return 0;
}


May I also mention that the ASCII code should be used to convert the letters (it's something like the characters - 32 or something).

I'm probably missing an integer and/or something in my code's logic to make it work. Because this is what I get when I launch the program.

Type some characters in: scHool.
Looks like you've finished your sentence...

There were s changes in the characters.

Press any key to continue...


A few issues that might help anyone understand this:
1. The program displays the first character (in this case - "s") as the number of changes. It should be a numerical value.

2. A lot of the time if I enter something, it will infinitely spam the output window with the first letter I entered. This goes on forever. This would happen if I entered "school" as "School."
Note: I realize I included <string> in my program. I don't think I need it. But maybe someone could briefly describe how to enable a program to read characters with spaces? Such as "Hello world. How are you doing today?"
Topic archived. No new replies allowed.