多线程的C程序,调用process.h不出结果
#include<stdio.h>#include<process.h>#include<stdlib.h>using namespace std;int a[100];void f1(void* p){ for(int i=0;i<100;++i){ a[i]=i; //system("pause"); }}void f2(void* p){ for(int i=0;i<100;++i){ printf("%2d",a[i]); //system("pause"); }}int main(){ _beginthread(f1,0,0); _beginthread(f2,0,0); return 0;}
_beginthread(f1,0,0);_beginthread(f2,0,0);