Re: Find the size of a datatype
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Mon, 22 May 2006 19:52:20 GMT
"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.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- Follow-Ups:
- Re: Find the size of a datatype
- From: Richard Heathfield
- Re: Find the size of a datatype
- From: Vladimir Oka
- Re: Find the size of a datatype
- References:
- Find the size of a datatype
- From: Rahul K
- Re: Find the size of a datatype
- From: Vladimir Oka
- Find the size of a datatype
- Prev by Date: Re: Translate from C/C++ to VB
- Next by Date: Re: Bytes to bits
- Previous by thread: Re: Find the size of a datatype
- Next by thread: Re: Find the size of a datatype
- Index(es):
Relevant Pages
|