Posting links to external sites just to read a bit of code is poor form.
This thread becomes meaningless if your URL vanishes.
main.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
extern"C" {
void f();
}
void func(void)
{
std::cout<<"\n being used within C++ code\n";
}
int main(void)
{
f();
func();
return 0;
}
test.c
1 2 3 4 5 6
#include <stdio.h>
void f(void)
{
printf("\n This is a C code\n");
}