I want to create a struct and use it in my program.In this case I want create this struct as a type. In my code I did create a "config.h" file. And my struct is in this file.
#ifndef LAST_TICKET
typedefstruct {
char routeName[10];
char sePointOne[32];
char sePointTwo[32];
char strtPoint[32];
char endPoint[32];
int fullTotal;
int halfTotal;
int lugeTotal;
int payMethod;
int cardNumber;
int currentTripUpDownStatus;
int currSecIndex;
int destSecIndex;
int ticketNumber;
int tripNumber;
double pasengerAmount;
double fullAmount;
double halfAmount;
double lugeAmount;
double total;
double balance;
}LAST_TICKET;
#endif
All configurations are inside of this file. The problem is If I call this file as "#include "config.h"" after that I can't call again this file any ware in my application. A am new to c and I want to do create a struct as a type and use it any ware in an application.
TheIdeasMan, thanks for reply. Actually it's working. I mean This. Suppose, I have config.h,a.c and b.c files. Now I have two typdef struct's in config.h for a.c file and b.c file. There are no relation between a.c and b.c. If I do include config.h in a.c it's working for a.c but not foe b.c. If I do include config.h in b.c it's working for b.c but not foe a.c. So now what I want to do.