Neville Franks wrote: What is the include file? Code posting rule one - Use the Formatting bar. 1) The include file is merely <iostream> , there's no ".H" extension. Including iostream is just for output strings (cout). For information about the new-styled include, please refer to ISO C++, the third generation of C++ programming language. If you just want to trace into step-by-step without displaying some msg on screen, you don't have to include iostream. 2) Yes I did. I used the "code" formatting (on top of the green face button, ":rolleyes:" ). But it seemd make my code red-colored but not well-format... X| X| X| Neville Franks wrote: Why is new static and not __cdecl and delete isn't static but is __cdecl? 1) Well, I traced into a normal new operator to look at what the prototype that VC++6 uses in file <new>. I saw it is :
void *__cdecl operator new(size_t) _THROW1(std::bad_alloc);
static, inline, and __cdecl are three different things. You may have already know what static and inline mean. __cdecl is just a hint to make the compiler know how to deal with the stack and formal arguments. Default calling convention VC++ uses is __cdecl. But you can change it by finding the setting: Project - Settings - C/C++ tab - calling conventions. 3) Why void* crashes but static void* runs, ... to tell the truth, I do not know. Just now I looked at some web pages discussing overloading global operator new, all of them say void* . I don't find any talking about void* crashing the program with VC++6. Maybe the one without "static" runs with your VC++.NET. I do not know. I don't have a VC++7 or 7.1. 4) size_t is just a concept of "number that you count". For example, one variable, two variables, three variables... Since the basic type of "number that you count" is integer, and there is no such " -1 apple, -2 apples ... ", size_t therefore is defined as "unsigned int"... BuggyMax