We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put a global variable?
`void marketing(char *filename, char *filename1){ system("cls");
float sumP,sumGF,sumPf,sumPP; // char* P[20],GF[20],Pf[20],PP[20]; PRODUCTO Premium; strcpy(Premium.Name,"Premium"); Premium.Price = 5; PRODUCTO Gold_funds; strcpy(Gold_funds.Name,"Gold funds"); Gold_funds.Price = 10; PRODUCTO Premium_funds; strcpy(Premium_funds.Name,"Premium funds"); Premium_funds.Price = 15; PRODUCTO Premium_Plus; strcpy(Premium_Plus.Name,"Premium Plus"); Premium_Plus.Price = 20; CUSTOMER marketingInfo,randomhuj; PRODUCTO productInfo; FILE *fp=NULL; fp = fopen(filename,"rb"); if (fp == NULL) { printf("File open ERROR"); getch(); exit(1); } FILE *fp1=NULL; fp1 = fopen(filename1,"rb"); if (fp1 == NULL) { printf("File open ERROR"); getch(); exit(1); } fread(&productInfo,sizeof(PRODUCTO),1,fp1); // fread(&randomhuj, sizeof(CUSTOMER),1, fp); //&& fread(&productInfo, sizeof(PRODUCTO),1 , fp) != 0 while(fread(&marketingInfo, sizeof(CUSTOMER),1 , fp) != 0) /* DONE (#1#): Problem with data comparison, same with password function? */ { /* TODO (#1#): POPRAWIÆ TUTAJ */ // &&strcmp(productInfo.Name,"Premium") if(strcmp(marketingInfo.Produto.Name,Premium.Name)==0) { sumP+=productInfo.Price*marketingInfo.Quantidade; // P = &productInfo.Name; // strcpy(P,productInfo.Name); } else if(strcmp(marketingInfo.Produto.Name,Gold_funds.Name)==0) { sumGF+=productInfo.Price*marketingInfo.Quantidade; // GF=productInfo.Name; } else if(strcmp(marketingInfo.Produto.Name,Premium_funds.Name)==0) { sumPf+=productInfo.Price*marketingInfo.Quantidade; // Pf=productInfo.Name; } else if(strcmp(marketingInfo.Produto.Name,Premium_Plus.Name)) { sumPP+=productInfo.Price*marketingInfo.Quantidade; // PP=productInfo.Name; } } printf("%s | %.2f |%.2f\n",Premium.Name,Premium.Price,sumP); printf("%s | %.2f\n",Gold_funds.Name,sumGF); printf("%s |%.2f\n",Premium_funds.Name,sumPf); printf("%s | %.2f",Premium_Plus.Name,sumPP); // printf("%.2f",sumGF); fclose(fp); getch(); system("cls"); } <!--EndFragment-->`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Put a global variable?
`void marketing(char *filename, char *filename1){
system("cls");
The text was updated successfully, but these errors were encountered: