// CreateMyThread.cpp : Defines the entry point for the application.
//#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
UINT PrintHello(LPVOID lpParam);int main(int argc,char * argv[])
{
DWORD ThreadID;
printf("Process printf:Hello World\n");
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)PrintHello,NULL,0,&ThreadID);
getchar();  //作用是什么
return 0;

}UINT PrintHello(LPVOID lpParam)
{
printf("Thread printf:Hello World!\n");
return 0;
}
运行结果正常:
Process printf:Hello World
Thread printf:Hello World!当我把getchar()这句话注释掉时,运行结果:Process printf:Hello Worldgetchar()不是从键盘上读取字符吗?在这里到底什么用啊?怎么会出现这种情况呢?