www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/10/23:30:37

Message-ID: <000401be3d1a$126670a0$0fa531ce@fresita-one>
From: "Jorge Ivan Meza Martinez" <jimeza AT usa DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: Time_t stuff
Date: Sun, 10 Jan 1999 21:53:20 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

Hello DooMWiz,

I could not find a problem there,
you are just printing two times the same value.

>int main()
>{
>  time_t now;
>  time(&now);

You give the actual time to the "now" variable

>  printf("Time is %d\n", now);

You  print the value of "now".

>  delay(2000);

You wait 2000 milliseconds.

>  printf("Time is %d\n", now);

You print the value of "now" variable.  that never changed its value.

>  return 0;
>}

You should add a "time(&now);" before the second print for refresh the "now"
value or
use "printf("Time is %d\n", time(NULL));" to always retrieve the actual
time.


bye,

   Jorge Ivan Meza Martinez
jimezam AT armenia DOT multi DOT net DOT co
          jimeza AT usa DOT net
      jimezam.home.ml.org

["O Lord, if there is a Lord, save my soul, if I have a soul--", Ernest
Renan]

-----Mensaje original-----
De: DooMWiz <DooMWiz AT TicNet DOT Com>
Grupos de noticias: comp.os.msdos.djgpp
Para: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Fecha: Domingo, 10 de Enero de 1999 06:01 a.m.
Asunto: Time_t stuff


>But the problem is that after the first time, it prompts you again for the
>time.  I really don't know what I should do.  Thanks in advance.


- Raw text -


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