Getting Input and WHITESPACES

This is a discussion on Getting Input and WHITESPACES within the C++ forums, part of the Application Development category; Code: #include <iostream> #include <string> using namespace std; string a; bool connected; int main() { getline (cin,a); cout << a ...


Go Back   Scriptasy > Application Development > C++
120 Online Register Projects Products Members List Calendar Today's Posts

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-02-2007, 05:52 PM
Junior Member
 
Join Date: May 2007
Posts: 15
Getting Input and WHITESPACES

Code:
#include <iostream>
#include <string>
using namespace std;
string a;
bool connected;
int main()

{
    getline (cin,a);
    cout << a << endl;
    system("pause");
}
i dont know how people actually already knew this but it took me quite some time to figure out

you use a string and getline(cin,string);
i hope this help alot of people :)
__________________
Mouse!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 01:11 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
scriptasy girl by HitmanN

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
W33