954,487 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to get input in formated style

if i hav to input time of clock as formatted style(HH:MM:SEC) using cin how can i write its code???? a question from @robert lafore(sams publication) .

hope to get a best answer soon :)

imsinu
Newbie Poster
12 posts since Nov 2011
Reputation Points: 6
Solved Threads: 0
 

ye' could chain the cin operation together like this:

cout << "Enter clock time: (HH MM SS) ";
cin >> hour >> min >> sec;

of course this method is highly dependant on the user making proper input seperated with white spaces.

Clinton Portis
Practically a Posting Shark
833 posts since Oct 2005
Reputation Points: 237
Solved Threads: 118
 

sr as we press enter after first input i.e hrs ,cursor will move to nxt line...and the format will no more look like that??? is there any possibilities to input in such format in c++ (input through array is avoided).

imsinu
Newbie Poster
12 posts since Nov 2011
Reputation Points: 6
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: