TITLE: Having a C main function PROBLEM: darren@omen2.sbil.co.uk (Darren Smith) ... No you do not need a c++ main program. However the streams library intialises several static members. If these are not initialised prior to a write to cout for example then the program will dump. You can get around this by calling the function _main(); as one of the first calls as part of your c main program. This will initialise the streams library. RESPONSE: steve@taumet.com (Steve Clamage), 7 May 93 That advice is VERY system-specific. The C++ language specification does not discuss writing the main program in any language other than C++. Some C++ implementations require that main be written in C++. Some C++ implementations allow main to be written in C, as long as it is compiled with with the vendor's C++ compiler in "C" mode. Some C++ implementations don't care what language or compiler is used for the main program, but require the vendor's linker to be used. Here is a portable solution which allows the main program to appear to be written in C: First, rename main. Let's assume we change the name of main written in C to be C_main. Then do the following in C++: extern "C" int C_main(int, char**); // it is a C function int main(int argc, char** argv) { // static constructors will be called first return C_main(argc, argv); // static destructors will be called afterward } Compile this as a normal C++ main program and everything should be OK. If your implementation allows an extra environment parameter to main, add the third parameter to C_main and to main.