Subj : Re: Compiling C code with Borland C++ To : borland.public.cpp.borlandcpp From : Nathaniel L. Walker Date : Thu Dec 09 2004 09:15 am Bob Gonder wrote: >Keith Woodard wrote: > >> Is there a way to use Borland C++ to compile C level code? > >Since C++ is C (plus more), obviously, yes, you can. > >Why? >Which compiler version are you using? >And what seems to be the problem? >Be as explicit as you can. >Others will be able to help you when they know the particulars. > > Why can't you just give him a straigtforward answer? Yes you can compile just C code. The easiest way to do so is to name your source code files with a ".c" extension, and the compiler will compile it in C mode. In fact, now that I checked, that looks like the only way to do it, since most C++ code is backward compatible with C (most, not all) and the C standard libraries are part of the C++ language (correct me if I'm wrong). If you want to form a file with a different extension to be compiled as C++ just use the "-P" command-line parameter (not that you' d want to). All in all, naming your source code files with a ".c" extension will tell the compiler to compile it in C mode. This works from the IDE and from the command-line. It's been that way since at least Borland/Turbo C++ 3.0, so your compiler version means next to nothing :) Ciao and happy coding! Nathaniel L. Walker .