you're getting screwed over by the globalization... what you did was instantiate paramvar in two different places...
what you need to do is include header.h in data_driver.cpp, and instantiate in main. then rewrite Get_Genetic_Distances to either take a reference to an int as it's argument, or return an int.
reworked, your files look like this (I'm using references):
header.h
Code:
struct paramvar
{
int nummark;
double loc_net_dist;
};
data_driver.cpp
Code:
#include <iostream>
#include "In_out.h"
#include "header.h"
using namespace std;
int main()
{
parmvar p;
datavar data;
Get_Genetic_Distances(data,p.nummark);
cout << "nummark is " << p.nummark << endl;
return 0;
}
in_out.cpp
Code:
//...
void Get_Genetic_Distances(datavar &data,int&p)
{
//...
inFile >> p;
cout << "Number of marks is " << p << endl;
//...
}