MS DOS is an operating system. C++ is a programming language.
No programming language is "for" MS DOS. You can programme in C++ using MS DOS as your operating system to run the programmes you need in order to write and build your code. You can write programmes using C++ that will run on MS DOS.
then what program do you use?
b'cus i tryde to use a console program in ms dos but it did not werk.
It just sase that this program can not be run is dos mode?
@Athar, there will always be enthusiasts who want to do something someone considers dead just for the sake of doing it or better understanding how things work.
If you want to run it on DOS, you could transfer the code to your DOS environment and compile it there with a DOS compiler.
I am aware of this one - http://www.delorie.com/djgpp/
Be aware that it appears to be 8 years old. Perhaps there are some more up to date DOS compilers, but I don't know.
[edit] Assuming the code you have written only uses the standard library, since I imagine many third party libraries are not DOS compatible.
Back when we were using DOS C++ was pretty unpopular among DOS systems, so there won't be many options especially now that C++ is popular DOS is dead.
You'd have more luck with C but pretty much every commercial DOS program I ever used was written in Assembly code with the DOS Assembler API. I don't know much about it (never sat there one day thinking about writing for a dead OS with a notoriously difficult assembler API) but I hear that programming for DOS defined a lot of the older programmers.
I reckon any C++ code written for DOS will run pretty poorly, since the DOS was not written to have heavy OS dependant memory grabbing OOP languages like C++ running on it. This sounds strange because these days C++ seems the opposite, but household DOS systems couldn't run shit.
Still though, this is just what I know from discussions with friends, since I've never wanted to touch DOS with a bargepole.
Don't be ridiculous. DOS was more than it has been given credit here. C++ was widely used in that platform, along with a host of other languages such as Pascal. Borland's compilers rocked back then!
DOS runs in real mode where any program can directly access video memory, system ports, etc.. That presented a lot of fun opportunities graphically.
Today, operating systems are usually multiuser and multitasking. In order to keep one thread of execution from interfering with others, the OS has to put boundaries in place. The result is called protected mode.
I, too, expected every old OS that has come and gone over the years to disappear until virtualization came about. Take VMware Player, for example. You can setup a VM and run DOS on your machine right now. You could use it for educational purposes, to run software that was written specifically on that platform, or even just take a trip back in time.
Ever heard of a BBS, ANSI art groups, or demo groups like the Future Crew? I used to spend hours writing software influenced by these things.
I didn't say DOS was at fault, I'd prefer a more open OS anyway, it's just that most household DOS systems could barely run games written in Assembler and maybe C, yet alone C++.
Anyway, I'm going to trust what you say even so, because, as I said before, this isn't from my own experience, just what friends have said.
And I happen to run DOSBox, which runs fine for me. Daggerfall FTW!
Hey guys I feel like I need to mention that "protected mode" is a feature that is physically built into the Intel family of processors and was so even back then. I don't care if you wrote a text editor or an Operating System, if you can't take advantage of a security feature that is handed to you then you need to GTFO of the game. TL;DR: There is a reason MS\PC-DOS are dead and it has little to do with users getting lazy and prefering a GUI.
@ moorecm: Perhaps a little nostalgia?: http://www.textfiles.com/
Some of the stuff here is just halarious to look back on.
I love all the different file extensions people were just making up for their ASCII art. That was a good thing about DOS, it didn't screw about with extensions.
I'm aware protected mode was an x86 thing as well, but I thought that moorecm realised that, it sounded like he did.
Am I right in believing C++ is designed to run on an OS? Nobody's said much about that but from the way it works I'm guessing that it relies on being compiled for an OS.
Also, I think DOS may have been made for the 8086 or 80186 originally because they don't have a protected mode. That way DOS could have just run in real mode from the 80286+.
Most of the stuff we write requires an OS to run, this is only because human beings are lazy creatures and we don't like to enumerate every DLL like resource and it's dependencies just to say "Hello World". If you care to take the time to export the functions from the drivers for your Hardware though you could write a stand alone OS in C++.
The reason I say this is because a lot of C++ is designed (particularly the standard library streams and memory allocations) to run on a Unix-style OS. However, I've heard that things like Windows 7 run on C++, completely counter-intuitive to what I know about the language.
So apparently you can write an OS in C++, along with other languages. Although I hardly doubt it will ever be suitable for a good kernel.