ttyname() - question

Jonas Heyman jonas at lkbpyr.UUCP
Wed Aug 30 00:16:39 AEST 1989


Hello,

I was wondering why this work:

--------------------------------------
#include <stdio.h>
main()
{
	char *term;
	char *ttyname();
	term=ttyname();
	printf("%d",term);
}
---------------------------------------

And why this don't:
--------------------------------------
#include <stdio.h>
main()
{
	test();
}

test()
{
	char *term;
	char *ttyname();
	term=ttyname();
	printf("%d",term);
}
----------------------------------------

All the above should type out your current 'tty',example: '/dev/tty023'.

Be glad for an answer,sincerely jonas

-- 

  jonas at lkbpyr.lkb.se 



More information about the Comp.lang.c mailing list