I can't seem to get a simple header file to work, when my teacher does it, it seems to work fine. Here is a short piece of code that I can't get to compile.
------------------------
//defines.h
#ifndef DEFINES_H
#define DEFINES_H
void foo();
void bar();
int nNum;
#endif
-------------------------
-------------------------
//driver.cpp
#include <iostream>
#include "defines.h"
using namespace std;
main()
{
foo();
bar();
cout << nNum << endl;
return (0);
}
-------------------------
________________
//process.cpp
#include <iostream>
#include "defines.h"
using namespace std;
void foo()
{
nNum = 5;
return;
}
void bar()
{
nNum += 1;
return;
}
---------------------------
Any help would be great, thanks