Re: Find the size of a datatype
- From: Vladimir Oka <novine@xxxxxxxxxxxxxxx>
- Date: Mon, 22 May 2006 21:21:00 +0100
Keith Thompson opined:
"Vladimir Oka" <novine@xxxxxxxxxxxxxxx> writes:
Rahul K wrote:
Hello all
Suppose I am given a datatype say X in C. How can i find its size
without declaring a variable or pointer variable of that type, and
of course without using sizeof operator.
Why "of course", and why without `sizeof`. That's what it's for,
after all.
One recourse remaining to you seems to be grepping/eyeballing for
the type definition in the code (or looking into the C Standard for
built-in types) and figuring it "manually".
That's not possible in general. No amount of looking into the C
standard will tell you how big an int is.
You're right, of course. I should have said "your implementation's
documentation".
--
But what can you do with it? -- ubiquitous cry from Linux-user
partner.
(Submitted by Andy Pearce, ajp@xxxxxxxxxxxxxxxx)
<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>
.
- References:
- Find the size of a datatype
- From: Rahul K
- Re: Find the size of a datatype
- From: Vladimir Oka
- Re: Find the size of a datatype
- From: Keith Thompson
- Find the size of a datatype
- Prev by Date: Re: Translate from C/C++ to VB
- Next by Date: Re: Translate from C/C++ to VB
- Previous by thread: Re: Find the size of a datatype
- Next by thread: Re: Find the size of a datatype
- Index(es):
Relevant Pages
|