Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 135,961 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,541 people online right now. Registration is fast and FREE... Join Now!




is it the same?

 
Reply to this topicStart new topic

is it the same?

shahnozajon
15 Apr, 2007 - 06:44 PM
Post #1

New D.I.C Head
*

Joined: 9 Apr, 2007
Posts: 13


My Contributions
cin >> number;
cin.get(number);

are these two the same?
User is offlineProfile CardPM
+Quote Post

Xing
RE: Is It The Same?
15 Apr, 2007 - 10:50 PM
Post #2

D.I.C Addict
Group Icon

Joined: 22 Jul, 2006
Posts: 723



Thanked: 2 times
Dream Kudos: 1575
My Contributions
No.
User is offlineProfile CardPM
+Quote Post

shahnozajon
RE: Is It The Same?
15 Apr, 2007 - 11:13 PM
Post #3

New D.I.C Head
*

Joined: 9 Apr, 2007
Posts: 13


My Contributions
QUOTE(Xing @ 15 Apr, 2007 - 11:50 PM) *

No.


how are they different? can you explain the difference?
User is offlineProfile CardPM
+Quote Post

Xing
RE: Is It The Same?
15 Apr, 2007 - 11:43 PM
Post #4

D.I.C Addict
Group Icon

Joined: 22 Jul, 2006
Posts: 723



Thanked: 2 times
Dream Kudos: 1575
My Contributions
get() does unformatted input. Gets raw characters, either single characters or chunks of characters.

This post has been edited by Xing: 15 Apr, 2007 - 11:50 PM
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Is It The Same?
16 Apr, 2007 - 01:38 PM
Post #5

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 48 times
Dream Kudos: 550
My Contributions
...
where cin >> number; is used to input formated data. i.e. it converts the text "123" into the interger 123.
User is offlineProfile CardPM
+Quote Post

shahnozajon
RE: Is It The Same?
16 Apr, 2007 - 02:01 PM
Post #6

New D.I.C Head
*

Joined: 9 Apr, 2007
Posts: 13


My Contributions
QUOTE(NickDMax @ 16 Apr, 2007 - 02:38 PM) *

...
where cin >> number; is used to input formated data. i.e. it converts the text "123" into the interger 123.


thanx for the reply!
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 09:31AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month