c – Analogue of the python ord ('x') of Si

Question:

What is the C analogue of Python's ord ('x')?

ord ('x') gives 120.

Answer:

No (int)'x' needed :

#include <stdio.h>
int x = 'x';
int main(void) {

    printf("%d  %d\n", x, 'x');
    return 0;
}
Scroll to Top