首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

多线程的C程序,调用process.h不出结果,该怎么解决

2012-10-15 
多线程的C程序,调用process.h不出结果C/C++ code#includestdio.h#includeprocess.h#includestdlib.h

多线程的C程序,调用process.h不出结果

C/C++ code
#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;}

为啥不出结果啊?
我用的codeblock,关掉了-mwindows选项

[解决办法]
C/C++ code
_beginthread(f1,0,0);_beginthread(f2,0,0); 

热点排行