Tanya Asked:2020-03-23 20:34:01 +0000 UTC2020-03-23 20:34:01 +0000 UTC 2020-03-23 20:34:01 +0000 UTC 在 C 中相当于 ord('x') 的 Python 772 什么是 C 中 Python 的 ord('x') 的等价物? ord('x') 给出 120。 c 2 个回答 Voted Best Answer Harry 2020-03-23T20:38:20Z2020-03-23T20:38:20Z 不需要:(int)'x' _ #include <stdio.h> int x = 'x'; int main(void) { printf("%d %d\n", x, 'x'); return 0; } KoVadim 2020-03-23T20:36:29Z2020-03-23T20:36:29Z #include <stdio.h> int x = (int)'x'; int main(void) { printf("%d\n", x); return 0; }
不需要:
(int)'x'
_