Stop being so smart guys :P
Which files should I include?
Dan
Stop being so smart guys :P
Which files should I include?
Dan
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)
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.
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.
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
ne time, dan
This war, like the next war, is a war to end war.