You cannot initialise a structure like that at run time. If you are using constant values then you can get the compiler to set it up by coding:
struct item_info
{
char itemname[15];
int quantity;
float retail;
float wholesale;
}item[NOOFITEM] =
{
{"rice",10,40,30},
{"sugar",10,40,30},
{"soap",10,40,30}
};
But if you want to assign values at run time then you have to do it manually like:
strcpy(item[0].itemname, "rice");
item[0].quantity = 10;
item[0].retail = 40;
item[0].wholesale = 30;