well this is just part of some code... granted its far from completetion and i have some comments to fill in some blanks but i need this portion of the code to work so i can continue with the rest of it... i was wondering if anyone would mind helping me out with these errors and warnings... im getting 7 errors and 6 warnings.... its kinda long so forgive me...
Code:
#include<stdio.h>
#include<string.h>
#include <ctype.h>
typedef struct
{
char brand[];
char bottles[];
int stock;
double price;
double cost;
}bev_t;
void LoadFiveEntries(bev_t entries[], int *size);
void Display(bev_t entries[], int *size);
void Delete(bev_t entries[],int *size, int location);
int find(bev_t entries[],int *size);
int main()
{
bev_t entries[150];
int size;
char selection;
size=0;
LoadFiveEntries(entries, &size);
while(selection != 'Q' || 'q')
{
if(selection == 'A' || 'a')
{
printf("Add\n");
//function for adding
}
else if(selection=='D' || 'd')
{
printf("Delete\n");
//function for deleting
}
else if(selection=='P' || 'p')
{
printf("Display\n");
Display(bev_t entries[], *size);
}
//continue with menu
else
{
printf("Command not recognized");
}
//prompt
//get next selection
}
//goodbye
return(0);
}
void LoadFiveEntries(bev_t entries[], int *size)
{
entries[0].brand="Bud";
entries[0].stock=500;
//4 other entries
*size=*size+1;
return;
}
//continue to [4]
void Display(bev_t entries[], int *size)
{
int i;
for(i=0;i<size;i++)
{
printf("\n");
printf("Brand: \t%s\n", entries[i].brand);
printf("Bottles: \t%d\n", entries[i].bottles);
printf("Stock: \t%d\n", entries[i].stock);
printf("Price: \t%d\n", entries[i].price);
printf("Cost: \t%d\n", entries[i].cost);
}
return;
}
void Delete(bev_t entries[],int *size, int location)
{
entries[location]=entries[*size-1];
*size=*size-1;
//delete array
return;
}
int find(bev_t entries[],int *size)
{
int usersize,userBrand;
int i,j;
char tempBrand[20];
char userBrand[20];
usersize=strlen(userBrand);
printf("\nWhich brand would you like to see?\n");
scanf("%s",userBrand);
for(j=0;j<size;j++)
if(strcmp(userBrand,entries[j].brand)==0)
return(j);
else
return(-1);
}