Oct 4, 2010 at 5:02am UTC
Hi all ,
i want to create my own function which will work like sizeof().
i can find out size trough pointers.
but i don't know how to write such function or how to call it
my_sizeof(int) ?? i think this will not work . any idea ?
thanks in advance.
Oct 4, 2010 at 5:56am UTC
Can you post an example call to this hypothetical function? What do you expect to take as input and to return as output?
Oct 4, 2010 at 6:05am UTC
thanks helios for reply.
i want something just lilke sizeof .
can i write some function which can be called like this
my_sizeof(int); // sending int , long to function
returns 4 .
i think another example is va_arg( va_list argptr, type );
where we can send data types.
can we have our own functions like above one.
i am trying for own sizeof .
Oct 4, 2010 at 7:51am UTC
well , nothing wrong with sizeof
just want to create function which can take data type as argument ,with sizeof like as sample.
my_function(int); // possible ?? in c++
thanks helios