Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

inclusion of a C FILE in C++ PROJECT...........

Is it possible to include a C file

in the project having C++ files?



for example in a c++ function

if i want to call a function

from that C file ,how can i do that?



whether i have to declare my C function

as a member of the c++ function class?



please help me.....


Comments

  • Yes it is possible. You would call the C function from the C++ file like any other C function. Make sure that in the header file for the C file you have something like:





    #ifdef __cplusplus

    extern "C" {

    #endif



    /* C function prototypes & external varables */



    #ifdef __cplusplus

    }

    #endif





    Hope This Helps,

    Justin


Sign In or Register to comment.