Click here to Skip to main content
13,793,266 members

C / C++ / MFC

 
AnswerRe: app is not running in debug mode Pin
Victor Nijegorodov9-Apr-18 23:46
memberVictor Nijegorodov9-Apr-18 23:46 
GeneralRe: app is not running in debug mode Pin
Member 838938610-Apr-18 0:14
memberMember 838938610-Apr-18 0:14 
GeneralRe: app is not running in debug mode Pin
Victor Nijegorodov10-Apr-18 2:03
memberVictor Nijegorodov10-Apr-18 2:03 
QuestionInter Process Communication between C++ - C# Pin
ptr_Electron8-Apr-18 19:13
memberptr_Electron8-Apr-18 19:13 
AnswerRe: Inter Process Communication between C++ - C# Pin
Jochen Arndt8-Apr-18 22:26
mvpJochen Arndt8-Apr-18 22:26 
AnswerRe: Inter Process Communication between C++ - C# Pin
Randor 9-Apr-18 11:03
professional Randor 9-Apr-18 11:03 
AnswerRe: Inter Process Communication between C++ - C# Pin
jschell14-Apr-18 6:48
memberjschell14-Apr-18 6:48 
QuestionHow cin.get() works in loop ? Pin
Tarun Jha7-Apr-18 4:32
memberTarun Jha7-Apr-18 4:32 
#include <iostream>
using namespace std;

int main(){
    char c;
    cin.get(c);                    //get a charecter from keyboard and assigns it to c

    while(c != '\n'){
        cout << c ;                 //displays the charecter on screen
        cin.get(c);                 //get another charecter
    }
}


int the code above shouldn't cout << c print every charecter i put in cin.get() in loop ?
Quote:
while(c != '\n'){
cout << c ; //displays the charecter on screen
cin.get(c); //get another charecter
}

instead it print the string i enter collectively, for ex.
Quote:

input : "Jhon simon"
output : "Jhon simon"

please explain


Thank you
SuggestionRe: How cin.get() works in loop ? Pin
David Crow7-Apr-18 7:34
memberDavid Crow7-Apr-18 7:34 
AnswerRe: How cin.get() works in loop ? Pin
Richard MacCutchan7-Apr-18 21:55
protectorRichard MacCutchan7-Apr-18 21:55 
AnswerRe: How cin.get() works in loop ? Pin
Peter_in_27808-Apr-18 22:13
professionalPeter_in_27808-Apr-18 22:13 
AnswerRe: How cin.get() works in loop ? Pin
jfbode10291-Jun-18 13:16
memberjfbode10291-Jun-18 13:16 
QuestionCListCtrl with group view enabled and long subtitles Pin
Friedbert Widmann5-Apr-18 23:43
memberFriedbert Widmann5-Apr-18 23:43 
QuestionHow can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w5-Apr-18 22:46
memberarnold_w5-Apr-18 22:46 
AnswerRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Richard MacCutchan6-Apr-18 0:26
protectorRichard MacCutchan6-Apr-18 0:26 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w6-Apr-18 1:31
memberarnold_w6-Apr-18 1:31 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Jochen Arndt6-Apr-18 1:55
mvpJochen Arndt6-Apr-18 1:55 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w6-Apr-18 2:30
memberarnold_w6-Apr-18 2:30 
AnswerRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Jochen Arndt6-Apr-18 0:36
mvpJochen Arndt6-Apr-18 0:36 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
arnold_w6-Apr-18 1:32
memberarnold_w6-Apr-18 1:32 
GeneralRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Jochen Arndt6-Apr-18 2:13
mvpJochen Arndt6-Apr-18 2:13 
AnswerRe: How can I initialize an array of structs where the array size is set at compile time? Pin
Joe Woodbury6-Apr-18 7:06
professionalJoe Woodbury6-Apr-18 7:06 
Questionwhy ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
Tarun Jha3-Apr-18 8:53
memberTarun Jha3-Apr-18 8:53 
AnswerRe: why ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
Victor Nijegorodov3-Apr-18 10:03
memberVictor Nijegorodov3-Apr-18 10:03 
AnswerRe: why ( const char *ptr = string literal ) works but ( const string *ptr = string literal ) doesn't ? Pin
David Crow3-Apr-18 11:41
memberDavid Crow3-Apr-18 11:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.181207.3 | Last Updated 10 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid