Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ scanf always expects double and not float

float max, zz, rate, time, percent;

printf("Please enter the size (in GB): ");
scanf_s("%f", &max);

printf("
Please enter how much you have downloaded already (in GB): ");
scanf_s("%f", &zz);

printf("
Please enter the downloadrate (in kB/s): ");
scanf_s("%f", &rate);
 
PREVIOUS NEXT
Tagged: #scanf #expects #double #float
ADD COMMENT
Topic
Name
5+7 =