February 4th, 2004, 05:16 AM
Is this So Costly ?
There is function like
MyFunction( T* apElements, int anCount );
As it can be seen it accepts an array as argument..
In my code, I have a pointer to array ( MyObject** ),
and I need to pass this array to the MyFinction...
If I write like followings in my code, does it becomes a costly operation? I mean, I do de-reference 'a pointer to array' to 'an array'; and the size of array is very large( e.g. 100.000 ); In this case how does 'de-referencing' behave ? Does it dereference all thousands of objects or something else ?
// create it...
// initialize them..
MyFunction( *pMyObject, 100000 ); // is this de-referencing costly?
Click Here to Expand Forum to Full Width