I have a binary file begins:
01 C8 01 FD 01 FB 01 F1 01 F3 01 F7 01 F6 01 F1 01 F4 01 FB 01 F4 01 FB 01 FA 01 F6 01 F7 01 F5
i.e. 16 bit integers, so array[0] = 0x1C8
In the past I have used GCC on LINUX and read/write files without any problem, though still a 'C' novice.
So, this compiles without error:
while((pDirent = readdir(dir)) != NULL) {
// printf ("[%s]\n", pDirent->d_name);
if( !strncmp( pDirent->d_name, "baseline.bas",11) ) {
printf("Found baseline!\n");
}
}
if( Readbase = fopen("baseline.bas","rb") == NULL)
printf("Open Baseline failed\n");
else
printf("Open Baseline success\n");
_getch(); // so I can see result
rewind(Readbase);
ii = i2 = 0;
while( fscanf( Readbase,"%x",&ii) != -1) {
printf("%x ",ii);
basefile[i2++] = ii;
}
basefile[i2] = 0; /* insurance! */
uDataPoints = i2;
printf("\nRead %d points\n", uDataPoints);
Output:
Directory: C:\BIN2CSV\Binary2csv
Open Baseline success
Read 0 points
Process returned 0 (0x0) execution time : 14.418 s
Press any key to continue.
Almost identical code from a LINUX compile ran without problem, so I've muffed it somewhere but cannot see how.
Also I set up the project with Debug turned off. How to turn it on?