8 Replies Latest reply: Mar 12, 2012 8:07 AM by Keith Barkley
stel_0 Level 1 (0 points)

Ι get this message when I use commands like clrscr(); system("pause"); etc...

any solutions

X-Code, Mac OS X (10.7.3)
  • xnav Level 5 (6,635 points)
    #include <stdlib.h>


    Will get system() past the warning, I don't know for clrscr().

  • Keith Barkley Level 5 (6,040 points)

    clrscr() is non-std C. It requires the non-standard conio.h

  • stel_0 Level 1 (0 points)

    hello guys. Thanks much for the input.

    Could u explain me how to install the externals stdlib and conio to X-Code ?

  • g_wolfman Level 4 (1,120 points)

    stdlib.h is part of the C standard libraries.  You don't have to install it, just use it as xnav indicated.


    conio.h was used by MS-DOS for supporting console I/O to text-based User Interfaces.  Don't install it.  Redesign your program to do I/O properly, possibly by using ncurses.

  • stel_0 Level 1 (0 points)

    I am a really newbie so I can't understand what you are talking about in your 2nd paragraph.

    So how can I install it?

  • g_wolfman Level 4 (1,120 points)

    OK, I'll try to explain it as simply as I can.


    You can't install it.


    "conio" (from CONsole I/O) was a C language module provided by Borland in the (now ancient) Borland C and Turbo-C compilers.  The purpose of conio was to provide certain functions that would make it easier to make text-based user interfaces in the MS-DOS console system (like the original Windows 3.1 GUI).


    It was only ever used when programming for MS-DOS and pre-WindowsNT versions of Windows based off of MS-DOS (like Windows 3.1).


    There is no conio module for OS X.  Therefore you cannot install it.


    I'm not even sure how, given your self-declaration as a newbie, you would have even run across the need to do a clrscr() call...are you trying to learn C from some old library book from the 90's?  Usually people who run into this are trying to port old, old code to OS X, hardly a newbie sort of task.


    Perhaps you could try explaining what you are trying to program; then people could provide more relevant advice.

  • stel_0 Level 1 (0 points)

    Thanks for your help m8.


    I am attending a programming-development course and I learn C by now at the 2nd quarter of the course, so I try to checkout all the commands.


    Thanks for the replies.

  • Keith Barkley Level 5 (6,040 points)

    For C (or any of the variants) it is critical to include the correct include file such as stdlib.h or stdio.h. Your command reference should clearly spell out which includes are required.


    If you are using a text by Schildt, I feel sorry for you, you will have to unlearn many things that are not standard C.