Questions tagged [type-casting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
217 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) { ...
  • 19
1 vote
2 answers
375 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 ...
  • 17.4k