3 ms·
There are much more subtle differences that will wreak total havoc without the compiler emitting a single squeak. For example, compare this compiled as C or C+
by mansr 15y ago
There are much more subtle differences that will wreak total havoc without the compiler emitting a single squeak. For example, compare this compiled as C or C++:
#include <stdio.h>
int foo;
int main(void)
{
struct foo {
int a, b;
} x;
printf("%zd\n", sizeof(foo));
return 0;
}
One should always write code in the best possible way for the language actually in use, even if this is invalid in some other language with superficially similar syntax. In converting code from C to C++, adding a few pointer casts will be the least of your worries.