How to use caps in the program?

While writing ur full name i want to show the output as surname in CAP

Page 1 of 1

1 Replies - 407 Views - Last Post: 20 February 2009 - 02:51 PM Rate Topic: -----

#1 HEDGE.c  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 05-December 08

How to use caps in the program?

Post icon  Posted 20 February 2009 - 02:45 PM

int main();

char name;
cout<< "Ehter your name :";
cin>>name;


i just know this in this program yet
Is This A Good Question/Topic? 0
  • +

Replies To: How to use caps in the program?

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,141
  • Joined: 14-September 07

Re: How to use caps in the program?

Posted 20 February 2009 - 02:51 PM

First, whatever the user enters the computer will only store a single character since name ios a char. Make it: char[], char*, or std::string

Also, for all caps:

toupper(char)



See full write up here
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1