sizeof « float « C Data Type Q&A

Home
C Data Type Q&A
1.binary
2.bit
3.byte
4.char
5.character
6.decimal
7.Development
8.float
9.hex
10.integer
11.prime
12.random
13.struct
C Data Type Q&A » float » sizeof 

1. sizeof float (3.0) vs (3.0f)    stackoverflow.com

What is the difference between sizeof(3.0) and sizeof(3.0f) I was expecting both of them to give the same result (sizeof float)..but its different. In 32 bit machine,gcc compiler, sizeof(3.0f) =>4 sizeof(3.0) => 8 Why so? ...

2. Why do the authors of the C/C99 standard, don't specify a ..standard for the sizeof floating point types?    stackoverflow.com

I noticed on windows and linux x86, float is 4bytes, double is 8, but long double is 12 and 16 on x86 and x86_64 respectively. C99 is supposed to be breaking ...

3. sizeof((int)(float)(char)i)) when int is defined (int)(float)(char) i;    stackoverflow.com

#include<stdio.h>
double i;

int main()
{
    (int)(float)(char) i;
    printf("%d", sizeof((int)(float)(char)i));
    return 0;
}
The above outputs 4 on a Micrsoft compiler. Why?

4. Determine `sizeof float` without compilation    stackoverflow.com

I'd like to know the size of a float in GCC, without having to run the compiler. I know one option is to write a small function and have the compiler ...

5. p=(char *)malloc((sizeof(float))["\000\006\010\013\015\100"])    bytes.com

fuzhen said: what's this? Checking the subject line, I guess you are referring to this: p=(char *)malloc((sizeof(float))["\000\006\010\013\015\100"]) to which the answer is that it's a badly written call to malloc. But, given suitable furniture (a function wrapped around it, , etc - and a semicolon wouldn't go amiss at the end there), it's perfectly legal, provided sizeof(float) doesn't exceed 6 on ...

6. (float) or (float*) wrt sizeOf()    cboard.cprogramming.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.