public, private and protected ...
essentialy, is their a speed diffenece ??
eg. say i have a var, and it public, but dosnt need to be, if i make it private or protected, is their ANY preformace gain ??
also, what are the key differences ...
thanx.
No. It''s just a compile-time thing.
A bit like the stop signs on roads, it doesn''t actually make you stop, but it tells you it''s probably a good idea to stop
Public: anything outside or inside your class can see it.
Protected: inside your class or classes derived from it you can see it.
Private: only inside the class itself can you see it.
A bit like the stop signs on roads, it doesn''t actually make you stop, but it tells you it''s probably a good idea to stop
Public: anything outside or inside your class can see it.
Protected: inside your class or classes derived from it you can see it.
Private: only inside the class itself can you see it.
i need a way of not sending unneeded variables through the memory (im creating a engine independent directx renderer and an opengl one) so stuff like vertexbuffer pointers and such dont need to be there
thanx
thanx
In order to do that, you''re going to have to do a lot more work. I don''t really understand the situation you''re trying to model though... are you trying to make a class that can do both, but that doesn''t take up the memory of the side that you aren''t using?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement