C++/C
Hi,
I have a c++ program (main is c++) and i use a lot of c in it with "external c" in the headers. I have one .cpp file with a class and some external c functions like class myclass : .... ... ... }; #ifdef _cplusplus extern "C" { #endif mycfuncs(); ... ... #ifdef _cplusplus } #endif So now i need to call mycfuncs() from another c function in another c file. The problem is including this header in c since it inludes a c++ class. How and can I exclude the class declaration if used in c? Thanks in advance. |
ok I solved it like this(goes throw the compiler):
#ifdef _cplusplus class myclass : .... ... ... }; extern "C" { #endif mycfuncs(); ... ... #ifdef _cplusplus } #endif |
All times are GMT -5. The time now is 12:13 PM. |