The following code compiles in C but not in C++:
int *ptr = 25; //why not in C++?
Error
prog.cpp: In function ‘int main()’:
prog.cpp:6:11: error: invalid conversion from ‘int’ to ‘int*’ [-fpermissive]
int *ptr = 25;
But this compiles in both C and C++:
int *ptr = 0; //compiles in both
Why does assigning 0 work fine and other numbers does not work?