Hello All,
I am migrating C program from Solaris to Linux and it's not working on Linux. I don't understand why and I googled but found no results. I have array of STRUCT and when passing to subroutine by value or by reference the object is null. Here is my code:
Code:
typedef struct {
char x[14], y[14], z[14];
} COORDINATES;
typedef struct {
char state[3];
char county[4];
COORDINATES coord[MAX_COORD];
} ARP;
ARP site[MAX_SITE];
//call subroutine
compare_positions(site[i].coord[j]);
Before passing to subroutine the values are good. But lost (null) when passed to subroutine. However, if I declared as single array then the value is passed fine. How do I fix this for Linux? I running gcc.
Thanks