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 Antworten
+ 1
I think code playground doesnt support header files..U should use cxxdroid app,it supports .h files plus its fully offline,u can practice as much you like,it has over 80 standard libraries ....
+ 1
see under build target files in project tab, did add.cpp included in there ? if not try to add it.
0
I am running it on code blocks
0
its been a long time, i' m sorry if i wrong
but probably your add.cpp was not compiled
make sure you compile all the required files by looking at build logs
0
actually if I run it in terminal it works fine but in code blocks it is giving errors
0
thanks u so much it helps