Mercurial > hg > Game > Cerium
view example/many_task/ppe/mymethod.cc @ 220:305ac1897c50 draft
fix
author | gongo@localhost.localdomain |
---|---|
date | Mon, 09 Feb 2009 21:58:45 +0900 |
parents | 028ffc9c0375 |
children | 0e1318e7caed |
line wrap: on
line source
#include "sort.h" #include "TaskManager.h" #include "Func.h" #include <stdlib.h> #include <stdio.h> void init_data ( Data *data , int size) { int i; srand(10); for (i=0; i<size; i++) { data[i].index = rand()%10000; data[i].ptr = 0; } return; } void show_data( Data *data, int size ) { puts("-----------------------------------------------"); for(int i=0; i<size; i++) printf("data[%02d].index = %d\n", i, data[i].index); puts("-----------------------------------------------"); return; } void write_data( Data *data, int size ) { FILE* fd; if ((fd = fopen("./sort.txt", "w")) < 0) { fprintf(stderr,"Can't open file"); } fprintf(fd,"-----------------------------------------------"); for(int i=0; i<size; i++) fprintf(fd,"data[%02d].index = %d\n", i, data[i].index); fprintf(fd,"-----------------------------------------------"); fclose( fd ); return; }