3 ms·
> all valid C programs will still compile, though not necessarily C++ ones I don't think that's true: struct foo { int a; int b; };
by markjdb 13y ago
> all valid C programs will still compile, though not necessarily C++ ones
I don't think that's true:
struct foo {
int a;
int b;
};
char arr[sizeof(struct foo) == sizeof(int) ? -1 : 1];
- aras_p 13y agoOk, proved me wrong! The ones that check for struct sizes at compile time (like in your example) will fail since sizes will be different now.