0

Hey, I made i looked up toupper and made a little program out of it and have come to a little situation, When i enter the space character " " it does not output what i want and it just closes.

#include <iostream>

using namespace std;

int main()
{
    int i = 0;
    char text[20];
    
    cout << "Enter A Word (Letters Must All Be Lower Case) : ";
    cin >> text;
    
    while(text[i])
    {
                  putchar (toupper(text[i]));
                  i++;
    }
    
        
    cin.get();
    cin.get();
    
    return 0;
}

Thank you in advance.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by joshmo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.