Re: difference between date & time



In <1188546533.444384.49170@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> alcool <fabio.maresca@xxxxxxxxx> writes:


void cfrDate(char h[], char min[], char y[],char mo[], char d[]){
struct tm *newtime, *oldtime;

newtime->tm_hour = (int)h;

You can't convert from a string to an int this way. Instead, use atoi().

newtime->tm_hour = atoi(h);

--
John Gordon A is for Amy, who fell down the stairs
gordon@xxxxxxxxx B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

.



Relevant Pages

  • Re: Subtracting unsigned entities
    ... they may be short, int, long, long long), what is the most portable ... For an unsigned int, the value will wrap every 47 days. ... as oldtime approaches UINT_MAX, ... is that newtime might occur after time wraps, ...
    (comp.lang.c)
  • Re: Subtracting unsigned entities
    ... they may be short, int, long, long long), what is the most portable ... For an unsigned int, the value will wrap every 47 days. ... as oldtime approaches UINT_MAX, ... is that newtime might occur after time wraps, ...
    (comp.lang.c)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
    (comp.programming)
  • RE: Controling Modal Dialogs (Solution)
    ... doesn't return until the 'modal' browser returns. ... string varOptions) ... public void DocumentComplete ... int rc = winDisp.Invoke(rgDispId, ref guid, 0, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Gcc compatible header file
    ... A string collection is a table of zero terminated strings that will grow ... typedef struct _StringCollection StringCollection; ... int; ... bool; ...
    (comp.lang.c)