I want to write a C code, say “test.c”, and call some C++ functions from it.
I have a header file header.h which has functions defined in it
and a C++ file which has definitions of the functions.
I’m unable to figure out compilation commands and how to use the extern command.
Can someone clarify this?
Try something like this in your header:
Then implement
foo()in your .cpp file. Make sure that your .cpp file also includes the header.