#include <stdio.h>
// File New Project Win32 Console Program
// List msvcrt.lib first on libs line and stdin and stderr won't work correctly
// Don't list msvcrt.lib and this program works though is much larger
int main(int argc,char *argv[]) {
char name[1024];
printf("Enter your name\n");
fgets(name,sizeof(name)-1,stdin); // this won't accept any keys
//gets(name); // security leak // this at least accepts keys
printf("Hello ");
fprintf(stderr,"%s\n",name); // this will not print anything
return 0;
}
It works when compiled with MINGW which always compiles with MSVCRT.LIB.