1
構造体から引き出しているncurses拡張文字を表示しようとしています。私が使用しようとすると構造体からncurses拡張文字を使用する
は:数値を格納する
#include <ncurses.h>
struct TEST_STRUCT
{
int nCharacter; // Where I want to store variable for printed character
short nTestNumber; // Other stuff in struct
};
TEST_STRUCT sTestData[] = {
{ '.', 1 }, // Period
{ ',', 2 }, // Comma
{ 4194424, 1 } // Vertical Line
};
int main(void)
{
initscr();
clear();
for(int n = 0; n < 3; n++)
{
addch(sTestData[n].nCharacter); // print the characters in the struct
}
endwin();
return 0;
}
:
ACS_VLINEの文字が正しく表示されない#include <ncurses.h>
struct TEST_STRUCT
{
char nCharacter; // Where I want to store variable for printed character
short nTestNumber; // Other stuff in struct
};
TEST_STRUCT sTestData[] = {
{ '.', 1 }, // Period
{ ',', 2 }, // Comma
{ ACS_VLINE, 1 } // Vertical Line
};
int main(void)
{
initscr();
clear();
for(int n = 0; n < 3; n++)
{
addch(sTestData[n].nCharacter); // print the characters in the struct
}
refresh();
endwin();
return 0;
}
は、少し周りをいじりの後、私は次の作品を見つけましたこれは間違っているようですが、うまくいきます。それを「正しく」実行するには、どうしたらいいですか?