Adam said:
hi
how could I use graphic in dos program, but compiled under windows
compiler? graphics.h could not be compiled under windows.
1. Standard C has no support for graphics
2. Standard C has no such header 'graphics.h'
3. There's a reason we have e.g. "Windows compilers",
"DOS compilers", "Unix compilers", etc. Each one
produces a binary compatible with its target platform.
So it makes no sense at all to try to run e.g. a program
produced by a Windows compiler on a DOS target.
4. Operating system is only one aspect of 'platform'. A compiler
must produce code which is compatible with the host system's
processor (e.g. Intel x86, Motorola 68xxx, etc).
5. The reason we have a standard C (and other) languages is
so that the same source code can be used to build programs
for many platforms. It's the compilers for each platform which
translate the source to the appropriate machine code.
6. There do exist products known as 'cross compilers' which
can run (compile programs) on one platform, but produce executables for
other platforms.
-Mike