Thread: clrscr() in microsoft visual c++

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    2

    Unhappy clrscr() in microsoft visual c++

    how can I declare clrscr() in microsoft visual c++?
    in borland c++, clrscr() is declared in conio.h
    or doesn't microsoft visual c++ support clrscr()? or does microsoft visual c++ has another function instead of clrscr()?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660

  3. #3
    Hello,

    The function clrscr() is not within the C++ standard. It was included in a few compilers, such as Borland, in the header conio.h. So far there is neither a standard function for C or C++ that will clear the screen. The languages are designed to be platform independant.

    You can always learn more about clearing the screen in the FAQ area.


    - Stack Overflow
    Segmentation Fault: I am an error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers, attempts to access a non-existent or read-only physical memory address, re-use of memory if freed within the same scope, de-referencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    2
    well, thanks all...

  5. #5
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119
    Opps bit late but for
    Quote Originally Posted by canliceset
    how can I declare clrscr() in microsoft visual c++?
    in borland c++, clrscr() is declared in conio.h
    or doesn't microsoft visual c++ support clrscr()? or does microsoft visual c++ has another function instead of clrscr()?
    Well microsoft didnt coded them and for these reasons i have code a library for VC containing all these functions goto mysite
    www.maxpert.tk an d download conumb if you need any help how to use or link it post it on forums over there
    Last edited by cfrost; 11-16-2004 at 10:31 PM.
    Software is like sex it is good when it is free

  6. #6
    Registered User
    Join Date
    Nov 2004
    Posts
    1
    system("cls");

  7. #7
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    system calls are not the best idea, read the same faq as Salem posted option 6
    Woop?

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    I have a 6 part tutorial on console programming at my web site. It statrs here. Clearing the screen is covered in part 2 but there are a lot of other potentially useful areas covered.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM