Re: Cin Help Programming Software Development by VernonDozier cin.get() gets one character, not a string. Perhaps you want … better off using the regular old >> operator with cin. cin >> firstword; cin >> secondword; Re: cin.get problems in use Programming Software Development by Narue cin.get only gets one character. If there are more than … char *msg = "" ) { cout<< msg; cin.ignore ( INT_MAX, '\n' ); cin.get(); } [/code] Of course, that's hackish compared to… Re: Cin question Programming Software Development by mike_2000_17 …minimize the terminal window and maximize again, this could trigger cin to flush the few letters you had typed before and… OS-specific stuff or a GUI platform of some kind. Cin is meant for command-line instructions: basically, "type …anything to cout and it will never show up in cin because although they share a terminal they are separate … Re: Cin Keyboard inpout to const char* Programming Software Development by Salem > Cin Keyboard inpout to const char* You want to "INPUT&… Re: cin.getline not working in for loop or...? Programming Software Development by Narue cin's >> operator and getline don't play well …. Formatted input treats whitespace differently than nonformatted input. More precisely, cin's >> operator leaves a newline character in the… Re: cin.getline not working in for loop or...? Programming Software Development by Narue >cin.ignore( 2, '\n'); Feel free to replace 2 with any arbitrary number. Someone invariably pipes in with something like this, but fails to do it properly. Once again, search the forum for a better solution. Re: Cin question Programming Software Development by Ancient Dragon >>cin is a buffer, it needs to flush, just like cout No it is not a buffer -- it is a c++ class. And cin can not be flushed. flush() only works on output streams, never input streams. Re: Cin Fail Method Programming Software Development by Ancient Dragon cin.fail is not used to keep the screen open -- it is used to simply test to find out if cin succeeded or not. If you want to keep the screen open call cin.get(). Re: cin input Programming Software Development by Lucaci Andrew `cin` waits till the user inserts something into the stream, and after that it takes into consideration the `'\n'` Re: cin.ignore Programming Software Development by tymk cin.ignore(this post); Re: cin.ignore Programming Software Development by Ancient Dragon cin.ignore() does not affect any of the characters in the … Re: cin a two word name Programming Software Development by Moschops cin >> nameone >> nametwo; cin help Programming Software Development by acardiac … really these functions work???? 1.cin.ignore() 2.cin.clear() 3.cin.good() 4.cin.fail() 5.cin.bad() 6.cin.eof() I mean to say… Re: cin help Programming Software Development by rudasi … you enter a different type eg, [code=cplusplus] int number; cin>>number; [/code] if you then enter an integer… enter a character it wont similarily, [code=cplusplus] char initials; cin>>initials; //the ">>" is an… Cin Programming Software Development by Danny_501 …is: "big St" but this causes the cin /getline function(have tried both) to write it into …. Big st, Little ave):" ;//<< endl; getline (cin, address.street); cout << "Enter suburb:" &…lt;< endl; getline (cin, address.suburb); cout << "Enter state:" <… Cin Help Programming Software Development by Dasttann777 …, secondword; cout<<"Input: "; firstword = cin.get(); cin.ignore(1,' '); secondword = cin.get(); if (firstword == "print") { secondword = firstword… Re: Cin Help Programming Software Development by Dasttann777 … string thirdin; int loop = 1; while (loop == 1) { cin >> firstin; cin >> secondin; if (firstin == "print") { cout… firstin)) cout << "Works"; } char q; cin >> q; return 0; } Also How would I do… Re: Cin Help Programming Software Development by Dasttann777 …; string thirdin; int loop = 1; while (loop == 1) { cin >> firstin; cin >> secondin; if (firstin == "print") { cout…(firstin[i])) cout << "Works"; } char q; cin >> q; return 0; } Thankyou! Re: Cin Programming Software Development by Danny_501 Never mind lol, I figured it out. I just put cin.ignore() after the problem line and it worked. thanks anyway lol. Re: Cin Help Programming Software Development by Daxmark …;"; char *car; int loop = 1; while (loop == 1){ getline (cin,word); if (strncmp(word.c_str(),"print",5)==0… Re: Cin Help Programming Software Development by Daxmark … divword= ""; int loop = 1; while (loop == 1){ getline (cin,word); if (strncmp(word.c_str(),"print",5)==0… Re: Cin Help Programming Software Development by m4ster_r0shi …;; interpreter_grammar<string::const_iterator> my_grammar; string str; while (getline(cin, str)) { if (str.empty()) break; int expr_type; string::const_iterator iter… Re: Cin help! Programming Software Development by gerard4143 Line 12. Why are you doing this [code] cin >> calc >> end; [/code] Why >> … <cstdlib> using namespace std; int main () { string calc; cin >> calc; if(calc == "calc") { system("… cin.get() HELP!!! Programming Software Development by trcartmill … 29 characters whichever comes first. I am trying to use cin.get() to read the name one character at a time… Cin help! Programming Software Development by Tom_Weston …; using namespace std; int main () { string calc; char end; end = ';'; cin >> calc >> end; if(calc == "calc… cin.getline and cin.ignore problem Programming Software Development by Meleeruler …project and it worked without having to use the cin.ignore after the specific cout statement. I was obviously… without it it skips the user inputing their data cin.getline(player1Name, NAME_LENGTH); cout<<"How … cout<<"Enter your name: "; cin.ignore(); cin.getline(player2Name, NAME_LENGTH); cout<<"How well… cin.fail() - why it fails after cin.get(...) Programming Software Development by superjacent …quot;Enter one character: "; cin >> getdata; cin.get(); char line[20]; cout…"\ncin.eof() = false"; if (cin.fail()) cout << "\ncin.fail… false"; // exit routine cin.clear(); while (cin.get() != '\n') continue; cin.get(); return 0; } … Re: cin.fail() - why it fails after cin.get(...) Programming Software Development by Ancient Dragon …lt;< "Enter one character: "; cin >> getdata; cin.get(); char line[20] = {0}; cout …; << line << "\n"; cin.ignore(); char line2[20] = {0}; cout <<…lt;< "\ncin.eof() = false"; if (cin.fail()) cout << "\ncin.fail() = true&… Re: cin.fail() - why it fails after cin.get(...) Programming Software Development by Ancient Dragon …lt;< "Enter one character: "; cin >> getdata; cin.get(); char line[20] = {0}; cout …of text 20 characters max: "; cin.getline(line2,20); //cin.ignore(); cout << "\…lt;< "\ncin.eof() = false"; if (cin.fail()) cout << "\ncin.fail() = true&… cin.getline() and cin.get() Inquiry Programming Software Development by Kamina00 … I was just looking up the difference between cin.get() and cin.getline(). It seems they can both function the…[200]; char name1[200]; char name2[200]; string hi; cin >> hi; cout << hi <&…;< name1 << "!" << endl; cin.getline(name2, 255); cout << "name2 " &…