Sklad4.c:299:13: предупреждение: format «%s» expects argument of type «char *», but argument 3 has type «char (*)[15]» [-Wformat]
Sklad4.c:304:13: предупреждение: format «%s» expects argument of type «char *», but argument 3 has type «char (*)[9]» [-Wformat]
#include <stdio.h>
# include <stdlib.h>
# include <string.h>
# define MAX 100
# define NAME 15
# define NAMEOFFILE file.myfilE
struct addsklad {
char name[NAME];
float price;
char date[9];
int postupilo;
int lost;
} adds_list[MAX];
int How_much_product_inthis_day_you_have(){
int hehe=0,hey=1,i2=0;
int wou=0,wwa=0;
int k=0,rr=0,zed=0;
int dd=0,mm=0,yy=0;
char V[4];
int a=0;
char d[4];
char l[4];
char w[MAX],ert[MAX];
int l1=0;
char p[MAX],i[MAX];
int D[MAX],l2=0;
int k2=0,t=0,n=0;
char y[MAX],yut[MAX],add1[MAX];
//тут была считака и проверка даты
printf("The date is:");
FILE *f;
hehe=2;
if(hehe!=1){
sprintf(ert, "%d.%d.%d", dd,mm,yy);
printf("%s\n",ert);
if((f=fopen("NAMEOFFILE","a"))==NULL){
printf("File can't open\n");
}
rewind(f);
fclose(f);
f=fopen("NAMEOFFILE","r");
a=0;
init_list();
while(!(feof(f)))
i2=0;
fscanf(f,"%d",&i2);
printf("%d",i2);
fscanf(f,"%s",&adds_list[i2].name);
fscanf(f,"%f",&adds_list[i2].price);
fscanf(f,"%d",&adds_list[i2].lost);
fscanf(f,"%d",&adds_list[i2].postupilo);
fscanf(f,"%s",&adds_list[i2].date);
//if (adds_list[i2].date == ert) {
printf("\n%s\n%f\n%d\n%d\n", adds_list[i2].name, adds_list[i2].price, adds_list[i2].lost, adds_list[i2].postupilo);
//}
//else{
//printf("In file there is no date like this((\n");
// break;
// }
i2++;
fclose(f);
}
else printf("Sorry, you enter sm-thing wrong\n");
}