I\'m trying to add an header file to dev-C++ but when I compile it it doesn\'t work. Here are my exact steps (for my example, I\'m trying to get mysql.h to work):
Its very simple ...
Just make Your header file and save it as .h extension.
Then use #include "file_name.h" instead of using include
Example- This is my header file.
#include
using namespace std;
namespace Ritesh
{
int a;
int b;
void sum();
}
void Ritesh::sum()
{
cout<
Then use of it-
#include
#include "Ritesh.h"
using namespace std;
using namespace Ritesh;
int main()
{
a=4;b=6;
sum();
}
Output- Output of program