Can anyone help me figure out what im doing wrong? I want to input a string of characters, or better yet, multiple lines of strings, and out put them as capital letters. What i have so far will allow you to input a string but it only outputs the 1st letter.
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int i;
char a;
string str;
cout << "Enter a string of characters to convert to uppercase: ";
for (i = 0; i < 100; i++)
{
cin >> str;
cout << (char)(toupper(str.at(a)));
}
return 0;
}