标题:求助啊,求助~
只看楼主
littledddna
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-7-18
 问题点数:0 回复次数:0 
求助啊,求助~
那位感人能指点一下,下面这段程序在写入数据的时候是怎么写入的啊? 是先循环14还是先循环800×800的数组?谢了~紧急啊~~~(NumY=NumY=800)

void WriteCloudStats(GRIDDEF *griddef, char *StatsDir, int month, int year, short ****DataTable)
{

     FILE *fptr[2];
     int i,j,k,l;
     char filename[200],command[250],monstr[5];
     GRIDDEF header;
         
     if(month < 10)
        sprintf(monstr,"0%d",month);
     else
        sprintf(monstr,"%d",month);
     
     sprintf(filename,"%s/CldYearlyStats_%d_%d.dat",StatsDir,month,year);
     sprintf(command,"/bin/cp %s %s.arc",filename,filename);
     system(command);
     fptr[0] = fopen(filename,"w");
     sprintf(filename,"%s/CldTotalStats_%d.dat",StatsDir,month);
     sprintf(command,"/bin/cp %s %s.arc",filename,filename);
     system(command);
     fptr[1] = fopen(filename,"w");

     for(i=0; i<2; i++){
         if(fptr[i] != NULL){
            WriteHeader(griddef,fptr[i]);
           for(j=0; j<14; j++)fwrite(
                                     &DataTable[i][j][0][0],
                                     sizeof(short),
                                     griddef->NumX*griddef->NumY,
                                     fptr[i]            
                   );
 printf("Data is %d \n",&DataTable[i][j][0][0]);
            fclose(fptr[i]);
         }
     }
}
搜索更多相关主题的帖子: month sprintf year GRIDDEF NumY 
2008-07-18 06:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-224271-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.380883 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved