Add solution for explizitesCasting.
This commit is contained in:
@@ -23,5 +23,20 @@ int getNumber(const char *text)
|
||||
while(getchar() != '\n') {}
|
||||
} while(!wasSuccessful);
|
||||
|
||||
return number;
|
||||
}
|
||||
|
||||
double getDoubleNumber(const char *text)
|
||||
{
|
||||
double number = 0;
|
||||
int wasSuccessful = 0;
|
||||
|
||||
do
|
||||
{
|
||||
printf("%s", text);
|
||||
wasSuccessful = scanf("%lf", &number);
|
||||
while(getchar() != '\n') {}
|
||||
} while(!wasSuccessful);
|
||||
|
||||
return number;
|
||||
}
|
||||
Reference in New Issue
Block a user