![]() |
friend class?
Does anybody know what this line means? I found CBotManager somewhere, as a friend class in the player.h
what is a friend class? I do not see a definition of it somewhere? Code:
class CBasePlayer : public CBaseCombatCharacter |
Re: friend class?
it's a class that when these two meet, they greet each other and have a drink together. :D
http://www.cplusplus.com/doc/tutorial/tut4-3.html *edit* btw, I'm at 13% downloading HL2 ;) |
Re: friend class?
argh, So there you have it. Unbelievable that you have a FRIEND class so you can bypass protected/private data. Well that makes a lot of use then for protected/private stuff.
still odd that the code compiles without any definition of the friend class in the hl2 sdk. But then again i did not read the entire page and could have missed something. I don't feel well today. I will burn some files for you PMB, and i hope to post it tomorrow. |
Re: friend class?
"friend" is a standard C++ keyword, just like "const" or "virtual", that's why you don't need to define it...
Million thanks for the CD Stefan :D |
Re: friend class?
The best way to remember this is...
"In C++, a friend is allowed to get at your private parts". :) I assume it would have to be a REAL good friend. botman |
Re: friend class?
lol @ botman :D
I use "friends" for classes that are related, ie CBotManager and CBot. |
Re: friend class?
Ladies and gentlemen, please welcome the latest pearl in the greatest BU quotes thread, by the botman himself! :D
|
All times are GMT +2. The time now is 16:10. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.