what is an underscore before a function name used to signify.
e.g. _toupper()
also what does it mean when a function name is preceded by 2 underscores.
__functionName()
thanks
Printable View
what is an underscore before a function name used to signify.
e.g. _toupper()
also what does it mean when a function name is preceded by 2 underscores.
__functionName()
thanks
Having a _ prepended is reserved for internals to the Standard Library, I think. More than one is reserved for compiler vendors (I think MS use three in some cases :p).
Basically, you're not supposed to use them in your code.
However, in C, all functions have a _ prepended internally (which is why if you don't get your linker settings right, you may get errors about _main()).
One underscore is for library internals or for compiler-specific extensions (like _itoa). gcc does not heed this because of POSIX requirements and similar things.
__ is usually for compiler-specific keywords (like __gc, __int64, __declspec etc.). I actually don't know any functions that start with __