View previous topic :: View next topic |
Author |
Message |
zaleha
Joined: 06 Apr 2008 Posts: 8
|
About get(c), put(c) and kbhit |
Posted: Mon Apr 14, 2008 1:10 pm |
|
|
hai all..
can anyone here help me on the explanation on the function of get(c), put(c) and kbhit function. I have read to the manual but still don't get a clear understanding of it and can a {while} being used twice in a same function? _________________ I am very new to the programming world...plus my english was not good at all. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 14, 2008 2:16 pm |
|
|
Please don't ask us to write tutorials on basic C language. That is
supposed to be done by your teacher in your class.
Here is what the CCS manual says. If you have a specific question
then post the question.
Quote: | getc() --
Gets a character on the receive pin(from the specified stream in case of
GETCH GETCHAR fgetc, stdin by default). Use KBHIT to check if the
character is available.
putc() --
Puts a character over the transmit pin (on the specified stream in the
PUTCHAR or FPUTC case of FPUTC, stdout by default)
kbhit() --
Returns true when a character is received in the buffer, in case of
hardware RS232, or when the first bit is on the RCV pin in case of
software RS232. Useful for polling without waiting in getc. |
|
|
|
40inD
Joined: 30 Jul 2007 Posts: 112 Location: Moscow, Russia
|
|
Posted: Mon Apr 14, 2008 10:28 pm |
|
|
Not all learn C in scool. Many people learn C by self |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Tue Apr 15, 2008 8:50 am |
|
|
I've learned more than I ever hoped I could from PCM programmer and others. I agree this board is not school. Think of it as a museum. Your code could be an exhibit. You have tried almost everything you know to get your code working so then you assume your code issue is unusual. You prove it is unusual by searching the forum to see if any one has had a similar experience. If it still appears unusual then put it on display in the museum and the visitors and experts will be interested enough to examine it and hopefully see a solution. No museum displays multiple exhibits of ordinary things. Slices of bread and glasses of water are unlikely to be exhibits in a museum.
They would make the museum uninteresting to visitors and experts alike. An example of a slice of bread is the Rs232 communication question or simple C questions like what does x++ mean. They have been asked and answered too many times to be interesting. |
|
|
|