#include <iostream>
#include <cctype>
#include <string>
using namespace std;
void inputnshow(string & a);
int main()
{
string sent;
cout << "The following program will convert a sentence and convert it to uppercase.\n";
cout << " " << endl;
inputnshow(sent);
return 0;
}
void inputnshow(string & a)
{
int n = 0;
while(n < 1)
{
cout << " " << endl;
cout << "Enter a string (q to quit).\n";
getline(cin, a);
toupper(a);
cout << a << endl;
cout << " " << endl;
cout << a << endl;
cout << "Next string (q to quit).\n";
getline(cin, a);
toupper(a);
cout << a << endl;
if(a == "q")
{
cout << "Bye" << endl;
system("Pause");
}
}
}
I keep getting an error with the, string a, variable. I tried using a char array, but that requires an initialization and I am looking for user input.