Red de conocimientos turísticos - Conocimientos sobre calendario chino - Código fuente multiproceso en segundo plano

Código fuente multiproceso en segundo plano

El código que escribí no se compiló. ¿puedes probarlo?

dword winapi suma hilo(lpvoid LP)//Suma hilo

{

int * sum =(int *)LP;

for(int I = 1;i<101;i++)

{

(* suma)+= I;

}

Return 0; //Retorno del hilo

}

dword winapi multhread(lpvoid LP)//Hilo factorial

{

int * mul =(int *)LP;

for(int I = 1;i<11;i++)

{

(* mul) * = I; /p>

}

Devuelve 0;

}

Hilo de impresión Dword winapi (lpvoid LP)//hilo de impresión

{

Manejar identificador;

int suma = 0;

int mul = 1;

identificar = CreateThread(NULL, NULL , SumThread, (LPVOID) & sum, NULL, NULL); //Crear un hilo de suma

CloseHandle(handle); //Cerrar el identificador del hilo

handle = CreateThread(NULL) , NULL, MulThread, (LPVOID) & mul, NULL, NULL); //Crear hilo factorial

CloseHandle(handle); //Cerrar el identificador del hilo

printf("% d ",sum);//Imprimir suma

printf("%d",mul);//Imprimir factorial

Devuelve 0;

}

void main()

{

Manejar identificador;

handle = CreateThread(NULL, NULL, PrintThread, NULL, NULL, NULL );

CerrarHandle(identificador);

}

lank">Red de conocimientos turísticos All Rights Reserved.