By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,797 Members | 1,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,797 IT Pros & Developers. It's quick & easy.

conio.h

P: 12
which header file can be used in C instad of conio.h as it is not there in C.
Sep 28 '06 #1
Share this Question
Share on Google+
3 Replies


100+
P: 144
Depends on what you are trying to do. The <stdio.h> header is probably going to be your best bet.
Sep 28 '06 #2

P: 30
http://www.koders.com/c/fid990B3D848CBAA20BB884EEBB39AF3F9E400D37D3.aspx

from this site you can download conio.h. Put this header file in your include directory. Before that just check why do you need this header file.
Sep 28 '06 #3

100+
P: 144
http://www.koders.com/c/fid990B3D848CBAA20BB884EEBB39AF3F9E400D37D3.aspx

from this site you can download conio.h. Put this header file in your include directory. Before that just check why do you need this header file.
The header file itself is useless without the library that actually implements the function prototypes defined in the header file.

You are better off using the <stdio.h> header. If you are trying to read from the console use the following (note that "stdin" is a macro that points to the standard input stream):

Expand|Select|Wrap|Line Numbers
  1. // reads from named stream and returns an unsigned char cast to an int
  2.  
  3. int getc(FILE *stream)
  4.  
  5. // equivalent to getc(stdin)
  6.  
  7. int getchar(void)
  8.  
  9. // reads in at most one less than size characters from stream and stores
  10. // them into the buffer pointed to by s.  Reading stops after an EOF or a
  11. // newline. If a newline is read, it is stored into the buffer. A '\0' is
  12. // stored after the last character in the buffer. Returns a pointer to s
  13. // on success and NULL on failure.
  14.  
  15. char * fgets(char *s, int size, FILE *stream)
  16.  
Sep 28 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.