- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] Your top-ten linux desktop apps
- From: O Plameras <oscarp@xxxxxxxxxxx>
- Date: Tue, 27 Sep 2005 13:46:04 +1000
- User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)
Erik de Castro Lopo wrote:
Peter Miller wrote:
C offers you enough rope to hang yourself.
C++ offers a fully equipped firing squad, a last cigarette and
a blindfold.
and better type safety that sh, tcl, php and a shit load of other
"advanced" make-the- type-up- at-run-time you-can-only-find- bugs-by-
customers-using- it-for- real-and- suing-you (that some simple compile
time static analysis would have found) scripting languages.
Thats why I'm so keen on O'Caml. It offers even more static analysis
than C and C++. Its significantly more difficult to write bugs into
an O'Caml program than a C or C++ program.
I do not know O'Caml, so I just want to ask the equivalent of ff code.
I can RTFM but if I can see the equivalent of this code, it'd be helpful.
I wish to have a quick idea of the language.
#include <stdio.h>
int integer_array[] = {1,-2,3,-4,5,-6,-7,8,-9,32727000};
int *ptr;
int main(void)
{
int i;
ptr = &integer_array[0];
printf("\n\n");
for (i = 0; i < 10; i++)
{
printf("integer_array[%d] = %d ",i,integer_array[i]);
printf("ptr + %d = %d\n",i, *(ptr + i));
}
return 0;
}
Thanks.
---
O Plameras
http://www.acay.com.au/~oscarp/tutor