conio vs stdio

This is a discussion on conio vs stdio within the C++ Programming forums, part of the General Programming Boards category; What is the difference? What is the history? Which is better?...

  1. #1
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231

    conio vs stdio

    What is the difference?
    What is the history?
    Which is better?
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  2. #2
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162
    Stupid Question

  3. #3
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231

    Exclamation

    Thanks. But I want the answer not the idea about them.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,328
    stdio.h is the standard C library header that deals with input and output. In standard C++ stdio.h is available, but there are other methods of input and output using streams in iostream.

    conio, conio.h, or conio.c are used for console input output that is specific to a particular compiler and platform. The functions available from them are not standard, and do not work with all compilers or platforms.

    If you are doing simple input and output in C++, use the stuff from iostream. If you are doing simple input and output in C, use stdio.h. If you want to do more advanced console input and output, you can use the functions from conio if your compiler supports them and you don't need to port your code to other platforms.

  5. #5
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    Yes my compiler supports all of them. But if stdio is portable and conio is not, and stdio can do anything that conio does(It seems it doesn't) why should I use conio?
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,328
    stdio cannot do anything that conio does. For example, if for some reason you need to get the character pressed by the user before they hit enter, then you may be able to use a function from conio, but there is nothing in stdio.h or iostream that can do that.

    If you have a task that can be accomplished by using something from stdio.h or iostream, then yes, you should prefer that one since it is more portable. Even if you don't change compilers, if you use conio and you post your code here for a question then only people whose compiler supports it will be able to run and test your code.

  7. #7
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    Thanks for good informations and spending time on it.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Listen to stdio of child process in parent
    By nitinmhetre in forum Linux Programming
    Replies: 2
    Last Post: 12-20-2006, 08:16 AM
  2. Putch - conio
    By black187 in forum Linux Programming
    Replies: 1
    Last Post: 05-11-2006, 01:25 AM
  3. conio linux and decisions
    By curlious in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 09-09-2005, 01:49 PM
  4. Replies: 0
    Last Post: 11-01-2002, 10:56 AM
  5. conio tutorial
    By aym_7 in forum C++ Programming
    Replies: 6
    Last Post: 08-10-2002, 01:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21