Writing a C program, fedora core linux system.
Here is the variable declaration of my main program
It's a pretty big program so I didn't post the entire thing, but when my variable declarations are like above, everything works fine.
If I try to declate a new variable anywhere it will give me a segmentation fault.
For exmaple, I can add
int myvar=0;
anywhere in the above code and it will give me segmentation fault.
What could be happening ?
Thanks for the help
Carl
Here is the variable declaration of my main program
Code:
MYSQL_RES *result;
MYSQL_RES *sresult;
MYSQL_ROW record;
MYSQL_ROW srecord;
char *dbserver="XXXXXXXXXXX";
char *dbuser="XXXXXXXX";
char *dbpassword="XXXXXXXXXXX";
char *db="XXXXXXXXX";
int billrunnumber;
struct ServiceCharge *ServiceCharges;
int servicecount;
struct ChargeCharge *ChargeCharges;
int chargecount;
struct BillingDisc billdisc;
struct BillRun br;
char brn_as_str[15];
char cyc_as_str[15];
char custquery[1000];
int current_cust;
It's a pretty big program so I didn't post the entire thing, but when my variable declarations are like above, everything works fine.
If I try to declate a new variable anywhere it will give me a segmentation fault.
For exmaple, I can add
int myvar=0;
anywhere in the above code and it will give me segmentation fault.
What could be happening ?
Thanks for the help
Carl