String Arrays

So what this program is supposed to do is have you input 10 names into an array then type a name you want to search for and output how many times that name appeared.

I get this error when I compile: http://imgur.com/C7SHBPl
I don't know what multi-character character constant -wmultichar means

here is my code:
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
#include<iostream>
#include<iomanip>
#include<string>
#include<ctype.h>
using namespace std;

 int main()
{


	//variables
	string name;
	string nameArray[10];
	int index;
	int instances;
	//call print header function
	PrintHeader("Introduction to Arrays", 'L' , 24);

	for( index = 0; index < 10; index++)
	{
		cout << "Enter name #" << index + 1 << ': ';
				getline(cin, nameArray[index]);
	}
	instances = 0;

	cout << "Enter name to search for";
	getline( cin, name);
	for (index =0; index < 10; index++)
	{
		if(nameArray[index] == name)
		{
			instances++;
		}
	}
	cout << instances << " of name: " << name;


	return 0;
}

This is the output, the expressions work, but the prompts aren't working
It should say something like:
Enter name #1: One
Enter name #2: Two
and so on..

Instead I get this:

Enter name #114880One
Enter name #214880Two
Enter name #314880Three
Enter name #414880Four
Enter name #514880Five
Enter name #614880Six
Enter name #714880Seven
Enter name #814880Eight
Enter name #914880Nine
Enter name #1014880Ten
Enter name to search forTwo
1 of name: Two

Any help is appreciated because I have no idea what is wrong.
1
2
3
4
5
for( index = 0; index < 10; index++)
	{
		cout << "Enter name #" << index + 1 << ': ';
				getline(cin, nameArray[index]);
	}


should be:

1
2
3
4
5
for( index = 0; index < 10; index++)
	{
		cout << "Enter name #" << index + 1 << ": ";
				getline(cin, nameArray[index]);
	}


Note the double quotes around the : instead of the single quotes. It's complaing about a multi character constant because of that.
Works!, can't believe it was that simple, and I completely understand why. Thanks a ton!
Topic archived. No new replies allowed.