What's in a (type) name?
What's in a (type) name?
Posted Sep 3, 2022 3:07 UTC (Sat) by ABCD (subscriber, #53650)In reply to: What's in a (type) name? by abatters
Parent article: What's in a (type) name?
The portable (as of C99) way to use printf and scanf (in userspace) with those types is to do things like:
#include <inttypes.h>
uint64_t x = 777;
printf("%" PRIu64, x);
scanf("%" SCNu64, &x);
        
      Posted Sep 3, 2022 16:37 UTC (Sat)
                               by pm215 (subscriber, #98099)
                              [Link] (5 responses)
       
 
     
    
      Posted Sep 3, 2022 19:55 UTC (Sat)
                               by SAI_Peregrinus (subscriber, #151778)
                              [Link] (2 responses)
       
When has that ever been a design principle of C? 
     
    
      Posted Sep 4, 2022 12:01 UTC (Sun)
                               by jezuch (subscriber, #52988)
                              [Link] 
       
     
      Posted Sep 5, 2022 11:06 UTC (Mon)
                               by pm215 (subscriber, #98099)
                              [Link] 
       
 
     
      Posted Sep 5, 2022 23:51 UTC (Mon)
                               by skissane (subscriber, #38675)
                              [Link] (1 responses)
       
Really, the C standards committee should introduce a nicer way of doing that. 
%(u64) or something like that. (I don't know which punctuation symbols are in use or reserved and which are not, but surely someone can come up with something which doesn't clash with existing uses.) 
     
    
      Posted Sep 6, 2022 23:02 UTC (Tue)
                               by dezgeg (subscriber, #92243)
                              [Link] 
       
     
    What's in a (type) name?
      
What's in a (type) name?
      
What's in a (type) name?
      
What's in a (type) name?
      
What's in a (type) name?
      
What's in a (type) name?
      
           