[help].c file and .cpp file

https://repl.it/@kakaducsy/WorthyLeafyBlog
I can't call c function on cpp project
What did you type in to compile and link things.

What were your error messages?

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");
}

The question is why? Is this a limitation of your build system?
What is your compiler?

Visual Studio 2017 digests your code without a problem.
Topic archived. No new replies allowed.