在 C++ 中获取 ncurses chtype 或 unsigned char 的整数值

Getting the integer value of a ncurses chtype or unsigned char in C++

我正在尝试获取 ncurses 替代字符 sheet 个字符的整数值。

#include <iostream>

int main() {
    uint i = ACS_S7; //I've also tried other values
    std::cout << i << std::endl;
}

虽然只是打印 0

也许你没有打电话给 initscr() 。在 ncurses 中做任何其他事情之前必须调用它。

在这种情况下,ACS_S7 是一个引用静态数组的宏,initscr() 设置的一部分根据当前语言环境等填充该数组