Skip to main content
gamedev.net
🔒 Locked

__________?

Started by Tiso Oct 1, 2000 at 2:38 PM 4 replies 500+ views
Original Post
Tiso
Tiso
Hi, I've been reading a tutorial that uses _ infront of a variable but uses the variable name to call it, and the other place I saw something like this: const IID IID_IBeepObj = {0x89547ECD,0x36F1,0x11D2, {0x85,0xDA,0xD7,0x43,0xB2,0x32,0x69,0x28}}; const CLSID CLSID_BeepObj = {0x89547ECE,0x36F1,0x11D2, {0x85,0xDA,0xD7,0x43,0xB2,0x32,0x69,0x28}}; IBeepObj *IBeep; I don't know what the _ stands for, is it a macro or something? Can somebody help? Edited by - Tiso on 10/1/00 4:16:11 PM
crazy-vasey
crazy-vasey
It might be Hungrarian notatation. It could also be message crackers but they aren''t classes. Most likely its just part of the name.

My Homepage
Tiso
Tiso
I don't think that has anything to do with notation, because when i put the mouse over some variable in vc++ the tool tip says: "__hbrush" instead "hbrush".

Edited by - Tiso on October 1, 2000 5:24:29 PM
Qoy
Qoy
It's just part of the name. For example, if I were using straight C, and making a struct, I might type this:

typedef struct _bullet
{
float x, y;
} bullet, *pbullet;


In that example, the actual struct name has an underscore, but the typedef has a bullet. C doesn't create types unless you typedef them (C++ does).

Also, it's customary to begin the names of obsolete functions with an underscore (such as _lread() ), or keywords that are compiler specific, or were compiler specific at one time (like _asm or _declspec), and also, many times global macros will be named with an underscore, so they don't interfere with your macro/function names (like _CrtDumpMemoryLeaks).

The underscores have nothing to do with the language, they're just part of the name of the variable, function, or type.

Edited by - Qoy on October 1, 2000 12:43:24 AM
Tiso
Tiso
Thanks I''ve been waiting for an anwser all day, gota go to sleep now.
sayshell
sayshell
it has nothing (directly) to do with hungarian notation

the first decl (IDD_Ixxx) is the constant ID of the com object(used to register it in the windoz reg),
while the second (Ixxx) is the interface to that com object

they differ significantly in use





--------------

come.to/faces
someday.......

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.