I'm studying the only instance now(in c++), and I tried the following code in my .cpp file.
#include "OnlyInstance.h"
OnlyInstance* OnlyInstance::instance = NULL;
..........
but the compiler told me "error C2065: 'NULL' : undeclared identifier". So is that means, I should
#include <stdio.h>
in front of it? But I also included stdio.h in the main file. So stdio.h will be included many times when compiling, right? How can I use NULL correctly?
Another question is that, I know I can use 0 instead of NULL, but which way is more recommended in c++?
NULL, you could also simply omit the initializer.