我在使用PDcurses显示一些符号时遇到了问题?而不是正确的字符。我做了一个小测试程序来显示代码页437,以确定哪些符号有效,哪些无效。
奇怪的是,当我关闭PDcurses时,出现问题的符号显示正确。
有问题的符号是圣形符号,即₧₧ƒ
这是不带PDcurses的源代码:
#include "stdafx.h"
#include <curses.h>
#include <iostream>
#include <panel.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//initscr();
char c;
for (int a = 0; a < 16; a++)
{
for (int b = 1; b < 17; b++)
{
move(a, b - 1);
c = b + (a * 16) - 1;
//addrawch(c);
cout << c;
}
cout << "\n";
}
//refresh();
//getch();
//endwin();
return 0;
}这是包含PDcurses的源码:
#include "stdafx.h"
#include <curses.h>
#include <iostream>
#include <panel.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
initscr();
int c;
for (int a = 0; a < 16; a++)
{
for (int b = 1; b < 17; b++)
{
move(a, b - 1);
c = b + (a * 16) - 1;
addrawch(c);
//cout << c;
}
//cout << "\n";
}
refresh();
getch();
endwin();
return 0;
}我正在运行Windows XP service pack 3并使用Microsoft Visual C++ 2010学习版
发布于 2011-02-04 02:39:13
我回来了,过了一段时间解决了这个问题。事实证明我使用的是错误的PDcurses版本。在可用的http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/中,我使用的是pdc34dllw。我切换到pdc34dll,现在它完美地工作了。
发布于 2010-12-05 22:33:34
当您在第二个示例中使用c a char而不是int时,会发生什么?
https://stackoverflow.com/questions/4358387
复制相似问题