Is there any lowercase null in any version of C++ language specification?
I was asked in an interview "Which of the following pointer initializations are valid?", and I filled the form something like:
// valid
    int* p1 = 0;
    int* p2 = 2-2;
    int* p6 = new int;
// invalid
    int* p3 = 1; 
    int z = 0;
    int* p4 = z;
// ???
    int* p5 = null;
                Is there any lowercase
nullin any version of the C++ language specification?
No.
A one word answer would be NO.
try the below code
  #include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
    int *p = null;
    int *q = NULL;
    return 0;
}
This gives the below error on compilation:
error: ‘null’ was not declared in this scope
Which is self explanatory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With