gpt4 book ai didi

c++ - 如何与ncurses画线?

转载 作者:行者123 更新时间:2023-11-30 04:56:51 26 4
gpt4 key购买 nike

我知道 C++ ncurses 的基础知识,但我不知道如何在两个坐标之间绘制一条简单的线。

例子:

2------------3

我怎样才能做到这一点?

最佳答案

   int hline(chtype ch, int n);
int whline(WINDOW *win, chtype ch, int n);

The hline and whline functions draw a horizontal (left to right) line using ch starting at the current cursor position in the window. The current cursor position is not changed. The line is at most n characters long, or as many as fit into the window.

至于角色,您可能需要 ACS_HLINE,但 - 可能也可以……也许更好。

关于c++ - 如何与ncurses画线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52331682/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com