Member Avatar
#include <iostream>
#include <stdio.h> 
using namespace std ;

int main ()
    char c ;
    c = cin.get () ;
        cout.put (toupper (c)) ; c = cin.get () ; 
    while ( !cin.eof () ) ;     

How can I make this capitalize only the first letter of the word? I've been trying for hours and I cannot figure it out. I have to use isspace (int)

I want to set up an if else loop, but I cannot get it to work.

Rather than getting it character by character, why don't you read the word into a std::string and capitalize that? Hint: std::strings are arrays and can have their chars changed one by one if necessary.