What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: one two three
#include
#include
using namespace std;
int main ()
{
string a;
cin.getline(a);
Suggested Answer: D
Get Premium CPP Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
8 comments · newest first
JU
Justa
11 months ago
I thought it would just take the first word.
TI
Titus
12 months ago
No way, it's not a compilation error!
GA
Gail
12 months ago
Wait, are you sure? What if it breaks?
SH
Shala
1 year ago
Definitely B, that's how getline works!
SY
Sylvie
1 year ago
It will output "one two three".
LA
Lavonna
1 year ago
This question seems straightforward, I'm pretty confident I can figure this out.
LO
Louis
1 year ago
This question seems straightforward. I'm pretty confident I can answer it correctly.
GL
Glory
1 year ago
I think the NCS 2000 Optical Service Channel might be built into the Transport System Controller, but I'm not entirely sure.