Question: If you get a compiler error on the following code, what is the probable reason? int * ptr = NULL; int x = 5 ;

If you get a compiler error on the following code, what is the probable reason?
int* ptr = NULL;
int x =5;
ptr = &x;
Group of answer choices
The first line should read int *ptr = nullptr;.
The first line is unneeded, as ptr gets assigned a value in the 3rd line.
Your compiler does not support C++11.
You wont get a compiler error on this code.

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 Databases Questions!