This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

About Keyboards - URGENT!!!!


Hello to anyone.....

I need some help in using the keyboard in C and on the GCC.

I need a function that reads n leters from the keyboard
that folow some rule.
The function prototype will be:

int *read_keyboard(int n;char rule);

The function MUST read exactly n characters and return IMEDIATLY (thingh
that the
functions of the C library doesn't does). If (n==0) the function just
return -1

The rule will be:

'n' or 'N' for numbers
'w' or 'W' for words (only a-z or A-Z)
'a' or 'A' for any character
's' or 'S' for these characters: ({[]})*/\?|><.,;:-_&%$#@!

If rule is not valid, then the function return -2.

Is desired that the param rule be optional so 'A' will be the default
and 
you can use:

int *c;
c = read_keyboard(10);

Or

int *c;
c = read_keyboard(10,'a');

And, is desired too that the function runs on Windows/Dos/Unix/Linux
systems....

Need response urgent.....
Thanks...
-- 
Nelson Guedes Paulo Junior   
E-mail:  <npaulo@linux.ime.usp.br>   UIN: 2489382 (Tender AML)
HomePage: (Em eterna construção)
http://members.xoom.com/DuneKiller/index2.html

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]