Paul Herring wrote:
>
>
> On Mon, Apr 20, 2009 at 4:22 PM, Tyler Littlefield 
> <[email protected] <mailto:tyler%40tysdomain.com>> wrote:
> > I would use pointers, it's easier to pass in one function call 
> rather than passing an object of what ever size.
>
> This is C++, not C.
>
> -- 
> PJH
>
> http://shabbleland.myminicity.com/ind 
> <http://shabbleland.myminicity.com/ind>
> http://www.chavgangs.com/register.php?referer=9375 
> <http://www.chavgangs.com/register.php?referer=9375>
>
> 
Whether it is C, C++, ASM, or C#, its going to be a lot faster to work 
with pointers than to copy around data for every little thing you do. 
(This is, of course, if the size is greater than the size of the actual 
pointer).

Let's use this class as an example:
class MyClass {
        private:
               unsigned long long mem0;
                .....
               unsigned long long mem31;
};

It would be much quicker to push and pop a 4-byte pointer than to push 
and pop a 256-byte class for everything you do with it. Hence, C++ gives 
us the "->" operator for object pointers.

Reply via email to