Xref: utzoo comp.lang.c:21282 comp.lang.c++:4494 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcsun!sunic!lkbpyr!jonas From: jonas@lkbpyr.UUCP (Jonas Heyman) Newsgroups: comp.lang.c,comp.lang.c++ Subject: ttyname() - question Message-ID: <99@lkbpyr.UUCP> Date: 29 Aug 89 14:16:39 GMT Organization: Pharmacia LKB Biotechnology, Uppsala SWEDEN. Lines: 39 Hello, I was wondering why this work: -------------------------------------- #include main() { char *term; char *ttyname(); term=ttyname(); printf("%d",term); } --------------------------------------- And why this don't: -------------------------------------- #include 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@lkbpyr.lkb.se