Δημοσιεύτηκε: 13 Ιούλ 2011, 15:01
Παιδιά, έχω αυτό το error
με αυτόν τον κώδικα:
Τι συμβαίνει;
- Κώδικας: Επιλογή όλων
19:1: warning: format ‘%s’ expects type ‘char *’, but argument 3 has type ‘int’
με αυτόν τον κώδικα:
- Κώδικας: Επιλογή όλων
#include <stdio.h>
main()
{
int kilos;
int money;
int money_to_pay;
char currency;
printf("What is the currency?\n");
scanf("%s",¤cy);
fflush(stdin);
printf("How many kilos is your product?");
scanf("%d",&kilos);
fflush(stdin);
printf("How much does a kilo cost?");
scanf("%d",&money);
fflush(stdin);
money_to_pay = kilos * money;
printf("You will pay %d %s",money_to_pay,currency);
}
Τι συμβαίνει;