conio.h required for getch??

Discussion in 'C' started by boygenius, Apr 25, 2008.

  1. boygenius

    boygenius New Member

    Joined:
    Apr 25, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    the getch() function is defined in conio.h.
    However the getch() works perfectly without including conio.h in the program.
    the same thing is also applicable to some other functions such sqrt(),malloc() etc.
    are these functions defined in stdio.h also or is there something else i don't know.

    is this okay or do i have some problem with my compiler.

    i am using turbo c/c++ to compile my programs.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    The function is only defined in the headers file mentioned under the help but sometimes when you include one header file it internally include some other files and so you can use them but it depends on the compiler you are using and when you use some other compiler then it will not work as expected.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice