Computing.Net > Forums > Programming > C programing in DOS

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C programing in DOS

Reply to Message Icon

Name: Daniel
Date: April 1, 2002 at 13:15:39 Pacific
Comment:

I am new to C and i am working on a simple DOS program.
Can anybody tell help me with a simple C function call that will
return a character if one has been entered from the keyboard or a NULL
if one has not, without stopping program execution and waiting for a
CR as happens with getch ().

If one is not avaible can somebody help me with some simple assembler
code that would do this?

Thanks in advance, Daniel.



Sponsored Link
Ads by Google

Response Number 1
Name: kelly
Date: April 2, 2002 at 12:25:57 Pacific
Reply:

getch() is a character input function with unbuffered input without echo, therefore it returns every character as soon as it is presed but does not echo it to the screen.

#include
#include

main() {
int ch;

while ((ch = getch()) != '\r')
putchar(ch);
return 0;
}


while ((ch = getch()) != '\r')



0

Response Number 2
Name: kelly
Date: April 2, 2002 at 12:34:24 Pacific
Reply:

you mentioned getch() waits for a carage return, I remembered that it is non-ANSI compilant so perhaps your compiler has defined it diferntly in the header file. You may want to check your documentation


0

Response Number 3
Name: Ray
Date: April 2, 2002 at 17:59:43 Pacific
Reply:

i will like to ask how to write a c programming code, by write the star use * only use this symbol???


0

Response Number 4
Name: kagingo .umar
Date: May 5, 2002 at 05:07:21 Pacific
Reply:

hullo, pliz i would like to meet a friend on the net who is informed about the c language programing so as to inprove ma skills in it. Pliz if there is any one willing to help me out , write to me on the following adress kagingo_u@yahoo.com
Pliz kelly if you have read this message do me a favour and any other person willing.
thanks alot.



0

Response Number 5
Name: amit
Date: June 4, 2002 at 02:43:27 Pacific
Reply:

DEAR FRIEND I AM TRYING TO FIND OUT THE FUNCTION THROUGH C IN WHICH IF THE USER DONT ENTER FOR SOME GIVEN STAPULIATED TIME IT SHOULD TAKE THE DEFAULT VALUE eg THE PROGRAM SHOULD WAIT FOR USER RESPONSE FOR SOME STIPULATED TIME.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C programing in DOS

how to compile C program in edit pl www.computing.net/answers/programming/how-to-compile-c-program-in-edit-pl/8975.html

to execute c program in editplus www.computing.net/answers/programming/to-execute-c-program-in-editplus/18714.html

C Programs and Dos Commands www.computing.net/answers/programming/c-programs-and-dos-commands/9066.html