ttyname() - question

Sun Visualization Products matthew at sunpix.UUCP
Sat Sep 2 03:14:11 AEST 1989


In article <1860001 at hppad.HP.COM> bazza at hppad.HP.COM (Carlos Bazzarella) writes:
)
)The second one doesn't work because when the 
)compiler gets to main() and sees test(), he doesn't
)know what to do with it, since it was not 
)previously defined or compiled. there are 2 things 
)you can do. first you could move the test() function
)prior to main(), that way by the time main() is 
)compiled, test() will the ready. second you could 
)declared test() on top of your program or in a include
)file, so when main() is compiled, test() will be given
)a function overhead, that way the linker will know what
)to do with test().
)a function declaration, for your case, looks like this:
)void test();
)  3    1 2 
)/* it reads: test (1) is a function (2) with no
) * returning value (void (2))
) */
)
)

What's this!!!

Sorry, This newsgroup is "comp.lang.c", not "comp.lang.pascal", function order
is not important.

The correct answer to this problem is the one previosly posted.  The 'ttyname()'
function call was lacking the file descriptor arguement.  Changing the function
call to 'ttyname(0)' fixes the problem.



-- 
Matthew Lee Stier                            |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |



More information about the Comp.lang.c mailing list