Re: Is it possible to compile and run c programs in the visual C++
- From: "Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach@xxxxxxxxx>
- Date: Tue, 25 Oct 2005 13:39:03 +0200
Hi Kueishiong!
When I create a new console project, the template main function created is always a C++ file from VC++ .NET. Is it possible to create a new project with the template main function created a C file?
There is no template for C-files. But you can simply rename the "cpp"-extension to "c" (or delete the file and create a new one).
You also should be sure to disable "pre-compiled headers" (in project properties "C/C++|Precompiled headers".
Also is it possible to have a project with both C and C++ source files?
Yes, there is no problem with that.
Just a small note:
If you want to include "c"-headerfiles then you must be sure that you put the following around them (or include this in the h-file):
#ifdef __cplusplus
extern "C" {
#endif#include "your-c-h-file.h"
#ifdef __cplusplus } #endif
-- Greetings Jochen
My blog about Win32 and .NET http://blog.kalmbachnet.de/ .
- Prev by Date: Re: C++/CLI equivalent to as keyword?
- Next by Date: Re: Graphic transforms
- Previous by thread: Separating Definition and Declaration of a class
- Next by thread: Re: serialization and deserialization problem
- Index(es):
Relevant Pages
|