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
#include<iostream>
#include<iomanip>
#include<string>
#include<ctype.h>
usingnamespace 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.