home bbs files messages ]

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

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

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

   Message 241,288 of 243,242   
   Kaz Kylheku to BGB   
   Re: Nice way of allocating flexible stru   
   11 Oct 25 00:02:58   
   
   From: 643-408-1753@kylheku.com   
      
   On 2025-10-10, BGB  wrote:   
   > Yeah, '0' by itself indicating octal is weird, so I might agree here.   
   >    123    //decimal   
   >    0123   //maybe reinterpret as decimal?   
   >    0o123  //octal   
   >    0x123  //hexadecimal   
   >    0b101  //binary   
      
   Lisp people worked this out before the end of the 80s:   
      
   [1]> 777   
   777   
   [2]> 00777   
   777   
   [3]> #o777   
   511   
   [4]> #x777   
   1911   
   [5]> #b1001   
   9   
      
   Leading zeros changing base is really a sneaky stupidity, and causes   
   problems in shell scripts also, from time to time.   
      
   $ printf "%d\n" 0777   
   511   
   $   
   $ echo $(( 0777 + 0 ))   
   511   
      
   --   
   TXR Programming Language: http://nongnu.org/txr   
   Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal   
   Mastodon: @Kazinator@mstdn.ca   
      
   --- 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