Re: macro for sizeof

From: Joona I Palaste (palaste_at_cc.helsinki.fi)
Date: 04/06/04


Date: 6 Apr 2004 20:59:27 GMT

Keith Thompson <kst-u@mib.org> scribbled the following:
> sweety_elegant@yahoo.co.in (Sweety) writes:
>> hello,
>> how to use macro to calculate the sizeof some data types.
>> plz explain .
>> thanks in advance.
>> bye,

> You got several responses when you posted this same question two days
> ago. If those responses weren't useful to you, you'll need to explain
> why before we can help you.

> It would also be helpful if you could tell us why you want to use a
> macro rather than the builtin "sizeof" operator.

Because his teacher asked him to?

-- 
/-- Joona Palaste (palaste@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"This is a personnel commuter."
   - Train driver in Scientific American


Relevant Pages

  • Re: macro for sizeof
    ... > how to use macro to calculate the sizeof some data types. ... > plz explain. ... You got several responses when you posted this same question two days ...
    (comp.lang.c)
  • macro for sizeof
    ... how to use macro to calculate the sizeof some data types. ... plz explain. ...
    (comp.lang.c)
  • functional ADT / shadowing built-in destructive macros
    ... specialized to do the right thing on functional data types. ... CL-USER> ... I'm assuming this is because cl:push is implemented as a macro, ... "If place is a functional ADT, returns a new data structure with the ...
    (comp.lang.lisp)
  • Re: GetByte(int x, int n)
    ... > I could bet that the macro will invoke UB if sizeof long> sizeof int, ... it is effectively 0 if we shift "out of" the largest ...
    (comp.lang.c)
  • Re: IS this a proper way of freeing memory with free()
    ... *If* you write a macro which allocates a Foo structure (this macro can ... What are you NOT getting about the fact that the cast is not needed ... sizeof to the wrong thing, the compiler won't warn you about it: ... int *p2; ...
    (comp.lang.c)