gcc 4.2.4
Version of implementation gcc of programming language Cgcc 4.2.4 is a bug-fix release, containing fixes for regressions in gcc 4.2.3 relative to previous releases of gcc.
Examples:
Hello, World! - C, Objective-C, C++ (68):
#include <stdio.h>
int main()
{
printf("Hello, World!\n");
return 0;
}
Factorial - C, Objective-C (67):
This example uses recursive factorial definition. Note that 13! and larger causes an overflow, so the last lines of the output look like this:
13! = 1932053504
14! = 1278945280
15! = 2004310016
16! = 2004189184
#include <stdlib.h> /* needed for EXIT_SUCCESS */
#include <stdio.h>
unsigned long long factorial(unsigned long long n)
{
if (n == 0) {
return 1;
} else {
return n * factorial (n - 1);
}
}
int main(void)
{
int n;
for (n = 0; n <= 16; n++) {
printf("%i! = %lld\n", n, factorial(n));
}
return EXIT_SUCCESS;
}
Comments
]]>blog comments powered by Disqus
]]>