getline() a string giving difficulty

前端 未结 3 555
逝去的感伤
逝去的感伤 2020-12-22 13:00

i am doing a task where i am inputting ist no of times you want to have input and then i am inputting a full line by the use of getline but sime how i am not able to do that

3条回答
  •  隐瞒了意图╮
    2020-12-22 13:37

    I believe your problem is you are giving input stream as a parameter where you should give buffer. Try this.

    {  
        char szInput[256];  
        cin.getline( szInput,256);  
        len = strlen(szInput);  
        cout<

提交回复
热议问题