Change all to capital vector problem

closed account (EwCjE3v7)
I have to do the following
Read a sequence of words from cin and store the values a
vector. After you’ve read all the words, process the vector and change
each word to uppercase. Print the transformed elements, eight words to a
line.

and for some reason there is no output

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <vector>
using std::cout; using std::cin; using std::endl;
using std::vector; using std::string;

int main()
{
    string input,  test;
    vector<string> container;
    unsigned counter = 0;

    while (cin >> input) {
        container.push_back(input);
        for (auto &c : container[counter]) {
            c = isupper(c);
        }
        cout << container[counter];
        ++counter;
    }
    return 0;
}
Last edited on
int isupper ( int c );
Check if character is uppercase letter
Checks if parameter c is an uppercase alphabetic letter.

Return Value
A value different from zero (i.e., true) if indeed c is an uppercase alphabetic letter. Zero (i.e., false) otherwise.
closed account (EwCjE3v7)
Oh, thought that would convert it to upper case. How do I convert that character into a capital?
You probably meant toupper rather than isupper.
closed account (EwCjE3v7)
Oh yes yes i did :/

Thanks guys,
Topic archived. No new replies allowed.