Name: Anonymous 2010-09-26 10:35
In your opinion, how would you compare the speed of the programs produced by the MSVC, GCC and ICC C/C++ compilers?
$ cat test.c
#include <stdlib.h>
int main(int argc, char *argv[]) {
int *p = malloc(sizeof(*p) * 100);
return 0;
}
$ gcc test.c
$ g++ test.c
test.c: In function ‘int main(int, char**)’:
test.c:3:37: error: invalid conversion from ‘void*’ to ‘int*’
$ cat test.c
#include <stdio.h>
int main(int argc, char *argv[]) {\
printf("%zu\n", sizeof('a'));
return 0;
}
$ gcc test.c ; ./a.out
4
$ g++ test.c ; ./a.out
1