Question: What does the following program output? #include using namespace std; int main ( ) { const char * w = Winnie the Pooh; const char

What does the following program output?
#include
using namespace std;
int main(){
const char* w = "Winnie the Pooh";
const char* ptr = w;
ptr +=2;
cout << ptr << endl;
}
Group of answer choices
he Pooh
(because the default integer size is 4 bytes, so it moves 8 characters)
Compile error because attempting to modify a constant.
nnie the Pooh
program crashes because of an attempt to read past the end of the string.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!