Search code examples
c++pdcurses

PDCurses blank character


I am trying to create a rougelike, and I am using windows for the different layers. The bottom most one is the map, and the one above that is the entity layer. I have the player character, and I want to move them around on the screen. I am printing a new @ (the way the player is represented) to where they move, and I am trying to put a blank space to where the character was, so that you can see the map layer where before you couldn't. I tried using NULL, but it outputs ^@. Any idea what I can use?


Solution

  • Use a blank character, ' ', or if you prefer just 32 or 0x20.

    NULL is actually defined as:

    #define NULL 0
    

    So you are writing the character with ASCII code 0, that is a NUL character, sometimes represented as Ctrl+@, or ^@.