0
How to get two strings in two lines?
I want to get a string that contains some sentences in line 1 and another string that contains tree digit in line 2 but after I try it 1th element of string1 changes! Why? cin.getline(sentences,200); //input:Hello! How are you? cin.getline(code,3); //input: 321
2 Respuestas
+ 1
Ms.Majd Is it your attempt which you added in description
0
What exactly do you mean?
That information can help you:
C++ <iostream> std::cin.getline(str, max_length) function/method gets user input until newline is occurred or max_length characters is reached and assigns it to str.