function overload problem:(char) and (char*)
-
It was a joke, programming questions are to be posted in the programming fora. This is the lounge, people asking programming questions in the lounge will be put in the comfy chair. I will probably regret this, but here is the real answer: When you pass the literal 0 to your function, the compiler will have no way of knowing if it is (char) 0 or (char *) 0. You will have to explicitly type cast it. In the Visual C++ forum you would have had the opportunity to get a better answer from eg. Christian Graus involving standard C++ type casts, I can only offer C style casts :-) : fun((char *) 0) or fun((char) 0). "After all it's just text at the end of the day. - Colin Davies "For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
I can understand.but I define another two:fun(int) and fun(int*),then I call fun(0),the compiler will compile successfully, and fun(0) will select fun(int) instead of fun(int*).why? thank your suggestion,I will go to the visual C++ forum. your friend:bobi