0
#include <stdio.h>
#include <ctype.h>

int main(void)
{
    char c = '+';
    int example = isalpha(c);
    printf("%i\n", example);
}

It should return 0 but it gives me random numbers. I really don't understand. I tried it with 'x', 'X', ')' to see what would be the result but they give random number either. I'm not sure how does this work if it's gonna give me random numbers either way. And yes this is up to date version of the program. I can't understand, is my Ram is broke or my processor... The results are:

-442407368

1873312952

1811287784

-841852568

...

3
  • The simplest explanation is that code is not in the compiled version of the program. Commented Jul 20, 2020 at 18:28
  • How is c declared?? Can you post the entire program code that is producing these results? I tried testing it, just to see what happens with c declared as an int and then as a char. Both printed 0 as expected.
    – Cliff B
    Commented Jul 20, 2020 at 20:12
  • I've updated the question.
    – user29200
    Commented Jul 21, 2020 at 5:37

0

You must log in to answer this question.