• Welcome to Valhalla Legends Archive.
 

Accessing one file's globals from another file

Started by tA-Kane, June 04, 2003, 04:13 AM

Previous topic - Next topic

Adron

Quote from: Zakath on June 17, 2003, 11:15 PM
On the other hand camel, a lot of your arguments don't really have anything to do with the necessity of using classes. Well-constructed procedural code can accomplish the same thing if you really want it to.

And that's what I (and some others) have been saying all the time. And regardless what Camel is saying, this *does* have to do with security. Not security from people with an intent to damage, but security from mistakes. joe shmoe may ZeroMemory your class or something, and that might cause a lot of trouble. Instead, declare a static variable for your data that needs protection, and there will be no way for him to mess up and zero it out.

Camel

#31
Quote from: Adron on June 18, 2003, 07:25 AM
And that's what I (and some others) have been saying all the time. And regardless what Camel is saying, this *does* have to do with security. Not security from people with an intent to damage, but security from mistakes. joe shmoe may ZeroMemory your class or something, and that might cause a lot of trouble. Instead, declare a static variable for your data that needs protection, and there will be no way for him to mess up and zero it out.

i think that's a little far fetched. of course classes aren't going to protect your variables, that wasnt the point. it's just for headache saving.
perhaps we can compromise:
#if Debug
class privatestuff
{
public:
   bool touchiagosPrivates(...);
private:
   struct privates the_privates;
} iagos_privates;
#else
static struct privates iagos_privates;
#end if

fair?

[edit] renamed iagos_privates::iagos_privates :)

|