Hi all,
This may seem like an easy question to many of you, but this is troubling me a little. How do u include a header file. Can anyone spell it out like i have never seen c++ before. The books i have dont say much about it.
heres what i have made in dev C++
heres sample.h
and here i would assume is the implementation file trial.cppCode:#include<iostream> using namespace std; void sample(){ cout << "help" << endl; }
i get an error that says main is being redifined and its being defined here, but in the sample.h its not there.Code:#include<iostream> using namespace std; #include "sample.h" int main() { sample(); system("Pause"); return 0; }
also is there a certain location that need to have the files for this to work?



LinkBack URL
About LinkBacks


