0
header file basic question:
//call.cpp #include "add.h" #include<iostream> using namespace std; int main() { cout<<addd(2,3); return 0; } //add.cpp #include "add.h" #include<iostream> using namespace std; int addd(int a,int b) return a+b; //add.h #ifndef ADD_H_ #define ADD_H_ using namespace std; int addd(int a,int b); #endif // ADD_H_ when i compile cal.cpp it give undefined behaviour of addd() please help where i have done wrong
6 Respuestas
0
it is not working if i put curly braces
0
i put curly braces around return statement then i compile cal.cpp again but it says undefined reference to addd(int ,int)
0
int addd(int a,int b)
{ return a+b;
}
0
when i compile Add.h it says undefined reference to main
0
i am using codeblocks
0
ok thanks