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 242,794 of 243,242   
   Richard Tobin to Kenny McCormack   
   Re: printf and time_t   
   05 Jan 26 14:53:22   
   
   From: richard@cogsci.ed.ac.uk   
      
   In article <10jfol6$2u6r8$1@news.xmission.com>,   
   Kenny McCormack  wrote:   
   >The question is: How can you reliably printf() a time_t value?   
      
   Do you want to print it in a human-understandable format?  Or a   
   non-binary format?  Or just in a way that's re-readable?   
      
   For a human-understandable format, the compiler needs to know about   
   the type.  Obviously this could be done for time_t, but for the   
   general case there would have to be a way for libraries to provide a   
   function that converts it to a string.   
      
   To handle the non-understandable formats, there could be format   
   specifiers to print binary and hex strings whose size is given by the   
   precision, like %.*s but not treating NUL as a terminator.   
      
   -- Richard   
      
   --- 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