in your main function you do
singleton* a= singleton::getInstance();
so the instance is set to the value the singleton got from the empty constructor. then you do
singleton* b= singleton::getInstance(9,12);
but you forgot that flag
is true because you set it to true in the empty constructor. so this line is meaningless.
after that, everything you do on b is the same as it was if you did it on a, so it doesn't work as you wanted