home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,306 of 117,927   
   albert@spenarnc.xs4all.nl to All   
   Confusion about pointers in c/cc   
   13 Mar 24 10:20:45   
   
   In a recent thread there was a confusion about pointers   
   in c/cc   
   Algol 68 has   
       'int' y;   
       'ref' 'int' py;   
      
   C has   
       int y;   
       int *py;   
      
   This defines py as something that can be dereferenced to   
   yield an int. This inside out type of definition leads to   
   confusion.   
      
   This is an example that you can compile with gcc   
   ------------------- pointer.cc ------------   
   #include    
   int main()   
   {   
       int y, *py;   
       py=&y;   
       printf("%x",py);   
   }   
   ----------------   
   Running it reveals the address of y, or at least the 32 least   
   significant bits.   
      
   I couldn't find back the thread, but this is a separate subject   
   anyway. Confirms the superiority of Forth ;-)   
      
   Groetjes Albert   
   --   
   Don't praise the day before the evening. One swallow doesn't make spring.   
   You must not say "hey" before you have crossed the bridge. Don't sell the   
   hide of the bear until you shot it. Better one bird in the hand than ten in   
   the air. First gain is a cat purring.            - the Wise from Antrim -   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca