I just started learning C and had a question about data types? I learned in theory that a long double has the size of 10 bytes but when I run it with
long double a;
printf("Size of long double = %ld bytes\n", sizeof(a));
The output is 16 bytes. Why is this the case?
Asked
Active
Viewed 50 times
1

Angel K
- 11
- 2
-
Not a bad question, but it is a duplicate nevertheless :D – Antti Haapala -- Слава Україні Nov 27 '18 at 18:11
-
https://en.wikipedia.org/wiki/Long_double which theory did you learn? – KamilCuk Nov 27 '18 at 18:11
-
https://en.wikipedia.org/wiki/Long_double - says that there are 10 significant bytes but that most compilers implement it as 16 bytes – pm100 Nov 27 '18 at 18:12