cindy13732
Technical User
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.
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.