Add solution for explizitesCasting.

This commit is contained in:
paulusja
2026-04-23 13:02:21 +02:00
parent 114a412778
commit 1a1837c7fb
3 changed files with 31 additions and 0 deletions
+15
View File
@@ -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;
}
+1
View File
@@ -3,5 +3,6 @@
unsigned char getSingleChar();
int getNumber(const char *text);
double getDoubleNumber(const char *text);
#endif