Questions tagged [type-casting]
The type-casting tag has no usage guidance.
2
questions
0
votes
1
answer
219
views
Typecasting with Modulo in Greedy
I'm having trouble getting the the modulo function to work in greedy using this code
int result = 0.0;
printf("SHOW ME WHAT YOU GOT: ");
float paid = GetFloat();
while (paid >= 0.25)
{
...
1
vote
2
answers
378
views
Why do we not get a warning when passing a string where we should pass an int?
If we try something like
char *str = "hello";
if (isalpha(str))
printf("%s\n", str);
we'd get a segmentation fault, because isalpha() takes int whose value must be in the range of an unsigned ...