Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

borland 6 - header file data not being seen

Status
Not open for further replies.

cindy13732

Technical User
Jun 9, 2011
9
0
0
US
My project doesn't seem to set the data correctly that is in a header file.

File 1: (x1.h) contains:
extern int var1;

File 2: (x2.h) contains:
var1 = 10;

File 3: (y.c) contains"
#include "x1.h"
#include "x2.h"
int var2;

var 2 = var1 + 1;


Problem: var1 is always 0

Does x2.h need to have "int" in front of var1? (int var1 = 10;)
Is there a way around this? This is vendor code.

x1.h originally did not have the extern. I get the same results either way.
 
just using your barebones code as given, I cannot get this to compile. More complete code woulod be helpful, but only the minimum amount needed to recreate the problem, please.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top