question about ctime(3) and time(2)

D. A. Dixon dixon at ihuxl.UUCP
Tue Apr 17 01:25:55 AEST 1984


Two points regarding the program 

main()
{
	long i;
	char *t;

	t = ctime(time(&i));
}


1.) time() returns a long where as ctime() requires the address of
    a long;

2.) on a PDP 11 you must declare time() to be a function returning
    a long, otherwise it will default to a function returning an
    int (which is a 16 bit quantity on the PDP 11). Also, as a matter
    of form you should declare ctime() to be a function returning a
    pointer.



D A Dixon
ihnp4!ihuxl!dixon



More information about the Comp.unix.wizards mailing list