I have two structure as below:
typdef struct abc
{
int id;
char name;
}s_abc,*lpabc;
typdef struct result
{
int acc_no;
lpabc *details;
}s_res;
I need to dynamically add the data within the structure result which points out to an array of pointers ie: struct abc
The structure abc could be an array of 5 values for eg.
How should i add the values ?
the structure defined are explicit: For better understanding i'm attaching the structure below:-
typedef struct _wfs_cdm_physicalcu
{
LPSTR lpPhysicalPositionName;
CHAR cUnitID[5];
ULONG ulInitialCount;
ULONG ulCount;
ULONG ulRejectCount;
ULONG ulMaximum;
USHORT usPStatus;
BOOL bHardwareSensor;
} WFSCDMPHCU, *LPWFSCDMPHCU;
typedef struct _wfs_cdm_cashunit
{
USHORT usNumber;
USHORT usType;
LPSTR lpszCashUnitName;
CHAR cUnitID[5];
CHAR cCurrencyID[3];
BOOL bAppLock;
USHORT usStatus;
USHORT usNumPhysicalCUs;
LPWFSCDMPHCU *lppPhysical;
} WFSCDMCASHUNIT, *LPWFSCDMCASHUNIT;
typedef struct _wfs_cdm_cu_info
{
USHORT usTellerID;
USHORT usCount;
LPWFSCDMCASHUNIT *lppList;
} WFSCDMCUINFO, *LPWFSCDMCUINFO;
Here i need to access the data of _wfs_cdm_physicalcu 4 times ie : an array.
detailsis a pointer to an array and you want to have manyabcs? Or do you want to change number of fields inabc? This is completely confusinglpabc *details;why are you creating pointer to a pointer? Maybe try post code with semantics and syntax you are trying to achieve.