I made this simple c++ program in code::blocks IDE:
#include <iostream>
#include "funct.cpp"
using namespace std;
int main()
{
float a, b;
cout << "enter a : ";
cin >> a;
cout << "enter b : ";
cin >> b;
cout << "\n\nThe result is: " << funct(a, b) << "\n";
return 0;
}
and this function:
#include <iostream>
using namespace std;
float funct(float x, float y)
{
float z;
z=x/y;
return z;
}
when I create the function in the IDE by creating new empty file and try to build the program it returns this error:
but when I create the same function file manually by the text editor and put it in the same folder of the project it works fine and the compiler can build it with no errors.
So is this because I am doing something wrong or is it a bug in the IDE ?
Can you help me out of this ?
and thanks in advance.