This is what the code looks like now.
Code:
int main(int argc, char* argv[])
{
string sentence;
int counter=0;
int count =0;
while (!cin.eof())
{
cin >> sentence[counter];
counter++;
}
for (int i=0; i<counter;i++)
cout << sentence[i]; //
cout << counter << endl; // just to double check it reads correctly
for (int j=0; j<counter;j++) // counter = number of char in sentence string
if (sentence[j] == argv[1]) // here is the issue
count++;
cout << "Count of " << argv[1] << ": " << endl;
return 0;
}
I will mess around with the code more and try what tapstop suggested.
:)