Suppose I have a C++ library lib.h that uses classes and templates. Suppose also that I have a custom C++ header myLink.h with the following:
#include "lib.h"
//call methods from lib.h that use templates and classes
// and return an integer based off of the information gained from calling functions lib.h
extern "C" int foo(int param1, const int param2);
Now suppose I am in a C file called test.c. Is it legal to call function foo() as follows?
//in test.c
int first = foo(5, 6);
Also, what is going on at the object code / linker phase of compilation?
Thanks!