K
kuoyang.hu
I write a program and want to get the byte 30 & 31 from file4 (file4 name came from "Ext_001"), the program will stop at "IWLo = fgetc(file4);", the final output is show "printf("Check point 1 ...\n");", I don't know Why?
char IWHi, IWLo; //I tried use int IWHi, IWLo; same result
int ImgLenHi, ImgLenLo;
int FCount = 1, R200=0, R300=0, Rot=0;
int Res;
FILE *file3 = fopen(FN_OK,"r");
if ( file3 != NULL )
{
printf ("Found : %s\n",FN_OK);
fclose(file3);
for (FCount; FCount <=3; FCount++)
{
switch (FCount)
{
// case (2):
//
// break;
// case (3):
//
// break;
// case (4):
//
// break;
default:
strcat (Ext_001,FN_999);
strcat (Ext_001,"_001.tif");
printf("getfileHHMMSS_001.tif = %s\n",Ext_001);
FILE *file4 = fopen(Ext_001,"r");
if ( file4 != NULL )
{
printf("Open getfileHHMMSS_001.tif = %s.\n",Ext_001);
if (fseek(file4,0,SEEK_SET) == 0)
{
if (fseek(file4,30,SEEK_SET) == 0)
{
printf("Check point 1 ...\n");
IWLo = fgetc(file4);
//printf("IWLo = %X",ImgWidthLo);
fclose(file4);
}
}
fclose(file4);
}
break;
}
}
return 0;
}
char IWHi, IWLo; //I tried use int IWHi, IWLo; same result
int ImgLenHi, ImgLenLo;
int FCount = 1, R200=0, R300=0, Rot=0;
int Res;
FILE *file3 = fopen(FN_OK,"r");
if ( file3 != NULL )
{
printf ("Found : %s\n",FN_OK);
fclose(file3);
for (FCount; FCount <=3; FCount++)
{
switch (FCount)
{
// case (2):
//
// break;
// case (3):
//
// break;
// case (4):
//
// break;
default:
strcat (Ext_001,FN_999);
strcat (Ext_001,"_001.tif");
printf("getfileHHMMSS_001.tif = %s\n",Ext_001);
FILE *file4 = fopen(Ext_001,"r");
if ( file4 != NULL )
{
printf("Open getfileHHMMSS_001.tif = %s.\n",Ext_001);
if (fseek(file4,0,SEEK_SET) == 0)
{
if (fseek(file4,30,SEEK_SET) == 0)
{
printf("Check point 1 ...\n");
IWLo = fgetc(file4);
//printf("IWLo = %X",ImgWidthLo);
fclose(file4);
}
}
fclose(file4);
}
break;
}
}
return 0;
}