I've been trying to print to the debug console and the code that I've found for printing string doesn't work. The following lines are what I have been using to print to the debug. But I received the following error on the OutputDebugString(newPos.c_str());
line: argument of type "const char *" is incompatible with parameter of type "LPCWSTR".
I've also placed below the position and player position structs that I've used in the code and that are created earlier in the code.
struct Position {
int x;
int y;
string currentObj;
};
struct PlayerPosition {
int x;
int y;
};
string newPos = gameMap[playerPos.x + 1][playerPos.y].currentObj;
OutputDebugString(newPos.c_str());
I've tried to go through some previous StackOverflow questions like this one and this other StackOverflow form here, but they haven't helped.