Okay I am being slightly lazy here but ...
I wrote a quick program that I have compiled and run under FreeBSD and Linux
using GCC and on Windows using Visual C version 6
=============== =============== =============== =============== =============== ====
#include <stdio.h>
enum { A, B, C} aa;
long bb;
int cc;
char dd;
int main(int argc, char** argv)
{
printf("enum %d long %d, int %d char %d\n", sizeof(aa), sizeof(bb),
sizeof(cc), sizeof(dd));
}
=============== =============== =============== =============== =============== ====
which gives this output
=============== =============== =============== =============== =============== ====
enum 4 long 4, int 4 char 1
=============== =============== =============== =============== =============== ====
on all systems.
There still remains the question however as to what the C++ standard claims
should be the case?
I have waded through the standard and have got myself lost in the usual
gobble dee gook in there.
Help, anyone know the definitive answer to this?
Having made a earlier claim I must now admit that I do not remember
sufficiently from my days on the Intel compiler, the VAX compiler and Sun
compilers if this is really the case?
Cheers,
Pep.
I wrote a quick program that I have compiled and run under FreeBSD and Linux
using GCC and on Windows using Visual C version 6
=============== =============== =============== =============== =============== ====
#include <stdio.h>
enum { A, B, C} aa;
long bb;
int cc;
char dd;
int main(int argc, char** argv)
{
printf("enum %d long %d, int %d char %d\n", sizeof(aa), sizeof(bb),
sizeof(cc), sizeof(dd));
}
=============== =============== =============== =============== =============== ====
which gives this output
=============== =============== =============== =============== =============== ====
enum 4 long 4, int 4 char 1
=============== =============== =============== =============== =============== ====
on all systems.
There still remains the question however as to what the C++ standard claims
should be the case?
I have waded through the standard and have got myself lost in the usual
gobble dee gook in there.
Help, anyone know the definitive answer to this?
Having made a earlier claim I must now admit that I do not remember
sufficiently from my days on the Intel compiler, the VAX compiler and Sun
compilers if this is really the case?
Cheers,
Pep.
Comment