Question: what is wrong with following program?

May 7, 2014 at 1:57am
I m doing the question and have to identify what is wrong with following program?

const int lineLength = 72;
cout<<"Enter a new value for lineLength:";
cin>> lineLength;

May 7, 2014 at 2:11am
Did you try running it? What do you think is the problem?
May 7, 2014 at 5:44am
So do you suggest run this code in cpp format and check it can run?
Thats the way to identify the problem?
May 7, 2014 at 5:50am
Yes, that is what he is suggesting. The compiler will tell you right where the code is wrong and what is wrong with it. Though, knowing the basics of C++ would have made the error obvious too.
Last edited on May 7, 2014 at 5:53am
May 7, 2014 at 2:12pm
because lineLength has "const" before, it cant be changed this program
May 7, 2014 at 2:55pm
@kusoipro

Please don't do people's homework for them. It doesn't help the OP learn anything.
Topic archived. No new replies allowed.