From owner-freebsd-questions Thu Oct 26 20:56:01 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id UAA22383 for questions-outgoing; Thu, 26 Oct 1995 20:56:01 -0700 Received: from terra.aros.net (angio@terra.aros.net [205.164.111.2]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id UAA22374 for ; Thu, 26 Oct 1995 20:55:57 -0700 Received: (from angio@localhost) by terra.aros.net (8.6.12/8.6.12) id VAA27065; Thu, 26 Oct 1995 21:54:44 -0600 From: Dave Andersen Message-Id: <199510270354.VAA27065@terra.aros.net> Subject: Re: Help -- Stupid "C" question. To: rkw@dataplex.net (Richard Wackerbarth) Date: Thu, 26 Oct 1995 21:54:43 -0600 (MDT) Cc: freebsd-questions@freebsd.org In-Reply-To: from "Richard Wackerbarth" at Oct 26, 95 07:05:19 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 744 Sender: owner-questions@freebsd.org Precedence: bulk Lo and behold, Richard Wackerbarth once said: > main () { > printf("It is now %s\n", ctime(time())); > }; > > The last one gave an answer, the rest core dumped. > > What should I use? Time requires a NULL argument to be passed to it. The return value from time(NULL) is an integer, whereas ctime() requires a pointer to a long int. Do something like long int thetime; thetime = time(NULL); printf("It is now %s\n", ctime(&thetime)); -Dave Andersen -- angio@aros.net Complete virtual hosting and business-oriented system administration Internet services. (WWW, FTP, email) http://www.aros.net/ http://www.aros.net/about/virtual/ "She totally confused all the passing piranhas"