I was reading about nullptr
and doing workout on g++ and also on VS2010.
When I did
#include <iostream>
using namespace std;
auto main(void)->int
{
int j{};
int* q{};
cout << "Value of j: " << j << endl; // prints 0
cout << nullptr << endl;
cout << "Value of q: " << q << endl; // prints 0
return 0;
}
printing the value of nullptr
on screen, g++ and VS gave compiler error.
Is it not allowed to print the value of nullptr
on screen?