c++ - My program doesn't put characters out on the screen -


i have tried several things none of them did work. know problem is? here's code:

#include <iostream> #include <windows.h> #include <iomanip> #include <fstream> #include <stdio.h>  using namespace std;   int winapi wwinmain(hinstance hinstance, hinstance hprevinstance, pwstr pcmdline, int cmdshow) {       cout << "hello world" << endl;      return 0; } 

thanks

if using visual studio, , create win32 application, not create console output not appear on window. if create win32 console application, std::cout directed console window need use standard main() program entry point.

to avoid creating new project, modify code shown here:

int winapi wwinmain(hinstance hinstance, hinstance hprevinstance, pwstr pcmdline, int cmdshow) {   allocconsole();   attachconsole(getcurrentprocessid());   freopen("conout$", "w", stdout);   cout << "hello world" << endl;   return 0; } 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -