f_and_c/example0/hello.cpp
2024-05-13 16:26:36 +08:00

15 lines
275 B
C++

#include <iostream>
extern "C" {
void add_number(float x, float y, float* sum);
}
int main() {
float a = 5.0;
float b = 10.0;
float result;
add_number(a, b, &result);
std::cout << "the sum of the numbers is " << result << std::endl;
return 0;
}