FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to make a .com file in C/C++





Nikkori
Can you teach me how to make a .com or .exe from .c or .cpp?
All I can see for example are only .obj and .cpp files with no .com or .exe?
I would like to view the output using a .com or .exe and I could'n't--I can only view my output when I run the program.
Besides, I want to e-mail my friends some C/C++ games I've made, and it will be funny if I send them .cpp files. I want them to just click the .com or .exe of my games Confused
Darkfall
As far as I know .com is a 'companion file' which runs when the exe of the same name is run.

It's commonly used in companion viruses.
Nikkori
So it is commonly .EXE what the C++ make?
{name here}
Nikkori wrote:
Can you teach me how to make a .com or .exe from .c or .cpp?
All I can see for example are only .obj and .cpp files with no .com or .exe?
I would like to view the output using a .com or .exe and I could'n't--I can only view my output when I run the program.
Besides, I want to e-mail my friends some C/C++ games I've made, and it will be funny if I send them .cpp files. I want them to just click the .com or .exe of my games Confused

A COM file is a very primitave executable for CP/M and early versions of DOS restricted to only 640k of memory(to put this into perspective, a modern 3 and 1/2" diskette holds more data) because it is a CP/M or DOS format and not a Windows format. It is pretty much hand made with assembly or the dead programming language PL/M most of the time.

An EXE file is a more advanced binary format used today for just about everything in windows. ELF format and a.out format are used on Linux and BSD. Depending on your operating system, the compiler will either crank out an EXE(Windows and OS/2), ELF(Linux) or a.out(BSD and various others) executable.

All you need to have and exe is you need to build the code with a compiler. If you sersiously don't know what a compiler is, I highly reccomend you go to Wikibooks and learn either C or C++ programming and learn the terminology. Their tutorial is pretty comprehensive, but kind of weak in some areas. You'll get everything you need to get started there, too.
Nikkori
Thank you for your information about the difference between the .COM and .EXE... I'll try it, maybe I'm just programming games without further knowledge about making a finshed-product-- .EXE.. Thanks!
egbert
.cpp or .c files are source code.

What you want to do is compile them using a c/c++ compiler.

I use this one.

What you'll do is open up the .cpp file, and then goto Execute - Compile.

It'll create a .exe in the same folder as your .cpp file.

That answer your question?
Related topics
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.