|
-
Nov 4th, 2002, 06:22 AM
#1
Thread Starter
Lively Member
naming conventions underscore
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
-
Nov 4th, 2002, 06:49 AM
#2
Monday Morning Lunatic
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 ).
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()).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 4th, 2002, 01:04 PM
#3
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 __
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|