Loading ...
Sorry, an error occurred while loading the content.
 

RE: [PrimeNumbers] A Prime Sieve, with Curt Landon Noll's approval

Expand Messages
  • chriscard1@netscape.net
    ... No. You didn t expect me to actually read the code did you? :-) Chris __________________________________________________________________ The NEW Netscape
    Message 1 of 5 , Feb 5, 2003
      Phil Carmody <thefatphil@...> wrote:

      >--- chriscard1@... wrote:
      >> Phil Carmody <thefatphil@...> wrote:
      >> >http://ioccc.org/2001/ollinger.c
      >> >However, it's output is pretty
      >
      >AAAAAAAAAAARGH!!!!!!
      >
      >> For me the output was "Segmentation Fault" :-(
      >
      ><<<
      >int main(int j,char *k[]) {
      >  int a,b,c,d,g,h,i=19;
      >  
      >  printf("       ");
      >  for(g=0[f=(char *)calloc(80+(h=atoi(1[k])),1)]=1; g<=h; g++) {
      >>>>                                   ****  
      >
      >You are ensuring that there is an element k in the array 1[], aren't you?
      >
      No.
      You didn't expect me to actually read the code did you? :-)

      Chris

      __________________________________________________________________
      The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp

      Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
    • Christ van Willegen
      ... Well.... Bear with me. It s all fully to spec. Also, it s totally off-topic, but of slight interrest to C-programmers out there... a[0] is the first
      Message 2 of 5 , Feb 10, 2003
        >
        >
        >>>For me the output was "Segmentation Fault" :-(
        >>>
        >>>
        >><<<
        >>int main(int j,char *k[]) {
        >> int a,b,c,d,g,h,i=19;
        >>
        >> printf(" ");
        >> for(g=0[f=(char *)calloc(80+(h=atoi(1[k])),1)]=1; g<=h; g++) {
        >>
        >>
        >>>>> ****
        >>>>>
        >>>>>
        >>You are ensuring that there is an element k in the array 1[], aren't you?
        >>
        >>
        >>
        >No.
        >You didn't expect me to actually read the code did you? :-)
        >
        >Chris
        >
        >
        Well.... Bear with me. It's all fully to spec. Also, it's totally
        off-topic, but of slight
        interrest to C-programmers out there...

        a[0] is the first (zero-th?) element of array a. The address of this
        element is &a[0]
        or plain a. The element itself can also be accessed as *a.

        Now, the address of a[b] is &a[b], or a+b. The element itself is *(a+b).
        Now, since
        the addition operator is commutative, this can also be written as
        *(b+a), which can
        be arranged to be b[a].

        So, a[b] == *(a+b) == *(b+a) == b[a]. So, yes, 1[k] _is_ a valid lange
        construct.

        Yes, I tried. Yes, it confuses the hell out of people.

        For a really unreadable example, see http://www.de.ioccc.org/1987/korn.c

        Regards,

        Christ van Willegen
      Your message has been successfully submitted and would be delivered to recipients shortly.