Trouble with curses

Boyd Roberts boyd at necisa.ho.necisa.oz
Tue Oct 30 10:13:38 AEST 1990


In article <20900012 at inmet> draper at inmet.inmet.com writes:
>
>Hi, this is Connie. I'm accessing this net with a friends account. 
>I have a question about the curses package. Heres the skeletal code:
>
> [deleted]
>
>  switch(tolower(getch())) {
>

What's the bet that tolower() is a macro?  And is coded to evaluate its
argument _twice_?  That way you get two calls to getch() instead of one.

Eg:

    #define tolower(c)	(chartab[(c)] & C_UPPER ? (c) - 'A' + 'a' : (c))

You've got to watch those macros when their arguments have side affects.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.lang.c mailing list