Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 ncurses 创建一个可滚动的列表,类似于aptitude(apt-get front end)中的列表。
aptitude
我应该如何在列之间创建填充空间?我打算使用wprintw().
wprintw()
例如
pizza spicy 10 steak normal 10 burritoes guacamole 20
每行使用 wprintw()。
以下将为您提供 2 个空格填充、左对齐、10 个字符宽的字符串列,每个后跟一个空格,然后是 2 位十进制列。
wprintw(win,"%-10s %-10s %2d\n", "pizza", "spicy", 10);