PDcurses displaying question marks in place of int

2019-08-07 04:38发布

问题:

Ive got a problem with PDcurses displaying some symbols as ? instead of the proper character. I made a little test program to display code page 437 to determine which symbols were working and which werent.

Strangely, when I turned off PDcurses the problem symbols displayed correctly.

The problem symbols are ÇéâäàåçêëèïîÄæÆôöòûùÿÖÜ¢£₧ƒ

This is the source code without 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;
}

This is the sourcecode with 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;
}

Im running Windows XP service pack 3 and using Microsoft Visual C++ 2010 Express

回答1:

I came back and solved this one after a while. Turns out I was using the wrong version of PDcurses. From the ones available http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/ I was using pdc34dllw. I switched to pdc34dll and now it works perfectly.



回答2:

What happens when you make c a char instead of int in your second example?