Forum Discussion
Altera_Forum
Honored Contributor
20 years agoc and cpp living together?
Hello forum, I am working on a project using c and c++ code with eCos. I notice that eCos is written mainly in c++, but many other components in my system is written with c. This leads me to su...
Altera_Forum
Honored Contributor
20 years agoHi,
You can find much info from google.com.cn by using key words "mixing C and C++". when using C++ style function in *.c file, you'll need to do a "C"-style function in the CPP file in order to to link it. e.g. in CPP extern "C" void CreateForm (void) { Form *frm = new Form(); } then in main.c extern void CreateForm (void); int main () { CreateForm () } FYI. David