Zoek de fout
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int tussen;
int antwoord;
int lengte;
int gewicht;
printf("Wat is je lengte?(meter)?");
gets(lengte);
printf("Wat is je gewicht?");
gets(gewicht);
tussen=lengte*lengte;
antwoord=gewicht/tussen;
printf("Je BMI gehalte is %d.\n",gewicht);
return(0);
}
Hoi,
Ik probeer mezelf momenteel C aan te leren. Daarna objective
-c. Nu zit ik al vast bij mijn eerste 'probeersel'.
De bedoeling is om simpelweg de BMI te berekenen van iemand, maar ik krijg alleen errors.
Kan iemand me helpen? De error is als volgt:
prut.c: In function ‘main’:
prut.c:13: warning: passing argument 1 of ‘gets’ makes pointer from integer without a cast
prut.c:16: warning: passing argument 1 of ‘gets’ makes pointer from integer without a cast
|