cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/01/20:38:57

Date: Mon, 2 Aug 1999 02:38:27 +0200 (MET DST)
From: Gisle Vanem <giva AT bryggen DOT bgnett DOT no>
To: djgpp AT delorie DOT com
Subject: Re: strftime BROKEN???
In-Reply-To: <37a4ba2d.323433@news.erie.net>
Message-ID: <Pine.UW2.3.95.990802023354.27766B-100000@bryggen.bgnett.no>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 1 Aug 1999, Radical NetSurfer wrote:
                    ^^
                  Why can't you state your real name instead of
                  some silly alias?

> When I try to compile this sample code (from the Libc.hlp file), it
> compiles with no problems, HOWEVER, it does not work!!!
> 
>    what's wrong ?!?
> how is it FIXED ?!?
> 
> #include <stdio.h>
> #include <time.h>
> 
> /* size_t strftime(char *buf, size_t n, const char *format, const
> struct tm *time);  */
> 
> struct tm t;
> 
> char buf[100];
> 
> strftime(buf, 100, "%B %d, %Y", &t);
> 
> printf("Date/Time: %s\n", buf);
> ----------------------------------------------------------------------------------------------------
> compiles: AOK
> outputs:  January 00, 1900                          
>               why this funky incorrect output?!?

What would you expect? You have to initialise 't' to some time+date
(using mktime for example).

> PLEASE: What other faulty things (ie SURPRISES) am I in
>                 store for with DJGPP ?!?

Learn C programming first, then you can complain about bugs you 
think you've found.

Gisle V.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019