So...
This is my stucture...and the following is the array:
Code:
typedef struct{
char name [50];
float price;
int noItems;
char expiry[50];
char type[50];
char detail[50];
}structure;
.
.
.
.
structure inventory[100];
WHat I am trying here is to copy each member of the last structure in the array to the first one in the array, considering both strucutres are populated with data.
arrayL = last structure in array.
num = first structre in array.
Code:
strcpy(inventory[num].name,inventory[arrayL].name);
(inventory[num].price) = (inventory[arrayL].price);
(inventory[num].noItems) = (inventory[arrayL].noItems);
strcpy(inventory[num].expiry,inventory[arrayL].expiry);
strcpy(inventory[num].expiry,inventory[arrayL].expiry);
strcpy(inventory[num].expiry,inventory[arrayL].expiry);
I get a bunch of errors though:
"89: invalid types `structure*[int*]' for array subscript"
EDIT: I dont want the data in inventory[num]....