When I compile and link the following program, it doesn't show me any issue.
#include <Windows.h>
#include <iostream>
int main(int argc, const char* argv)
{
std::string cMessage = "Native Windows Development.\n";
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), cMessage.c_str(), cMessage.size(), NULL, NULL);
return 0;
}
But when I execute the program, it shows me just a bunch of ????? sign in the console. what is the problem with the code? Why I can't use std::string rather const char* ?
WriteConsoleA.