Thread: Some DOS text questions :)

  1. #16
    Registered User
    Join Date
    Apr 2003
    Posts
    7
    Stop being so smart guys :P

    Which files should I include?

    Dan

  2. #17
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    if it does what you want it too, then you have already included all the files you need.

    none of the functions used to clear the screen are std. system calls are OS specific. clrscr() is in a non std header file called conio.h, I believe. You could always use a loop which outputs a blank line 20 to 30 times to maintain standard C++ code if you don't want to use non standard code, although you have already used non standard code if you use SetConsoleCursorPosition(). Nor are you using true DOS code if you are using a console program (the console code mimics DOS but isn't DOS)

  3. #18
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    Hold up, elad. clrscr(), gotoxy(), goto(), and other conio.h things aren't always there. the only thing in my conio.h is getch(), and thats it. I have to make my own gotoxy, and make them much much better, like, void gotoxy(string szText, int X, int Y);
    so its much easier to use.

    And also, Dan, some compilers and systems don't need to include, it includes everything for you. For example:

    My systems need to inlude <iostream>, but cannot use <iostream.h>, while my friends systems needs <iostream.h> but cannot use <iostream>, And somesystems don't even NEED iostream files.

    For my gotoxys and write a sentence, i need to include <iostream>, <string> and i need to have using namespace std; on it.

    Just mess with it to see what your compiler needs.
    This war, like the next war, is a war to end war.

  4. #19
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    conio.h is a non-std file with non-std functions. I know that some versions of conio.h (in my compiler for example) have more than just getch(), but some apparently just have getch(), and others may be different yet. That's the nature of non-std files.

    I don't know for sure, but I suspect strongly that all compilers need some file to be included before a file/program can be compiled. The compiler may be set up to include some files for you as a default, but something is still needed. I use IDEs rather than command line compiler only, so I don't have to use all the flags and switches for linking etc., my IDE does it for me by default. I don't doubt that some IDEs/compilers may include some version of iostream or stdio by default, too.

  5. #20
    Registered User
    Join Date
    Apr 2003
    Posts
    7
    Well I use blodshed dev Seem to be a good compiler. I should try make a program without any includes.

    Anyways thanks for the help, especially blizzarddog for that code you sent I will try make it a function myself, I haven't really learnt functions yet I'm such a noob..

    Dan

  6. #21
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    ne time, dan
    This war, like the next war, is a war to end war.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Text Enhancement from DOS console
    By 3DMatrix in forum C++ Programming
    Replies: 8
    Last Post: 06-06-2004, 08:12 AM
  2. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM
  3. static text in DOS
    By Goof Program in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-29-2002, 02:57 PM
  4. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM