I have written a simple file application to read input data from a file. I have tried to remove space(32) and newline(10). The output is File program
#include <stdio.h>
int main()
{
FILE *f;
char c;
unsigned char buf[512],i=0;
printf("in f_read\n");
f = fopen("S:\\db\\result-enc.txt","rb");
while( fscanf( f, "%c", &c ) > 0){
if(c==32 || c==10)
;
else
buf[i++]=c;
}
buf[i]='\0';
printf("%s\n",buf);
return 0;
}
data
61 AF AF BF 26 00 66 A6 E6 4B E1 C8 68 20 21 38
AE FD 4C DF 40 39 08 32 82 29 B0 1D FE 17 ED 96
C3 66 6D 4A 12 1C E1 05 84 FF A8 85 C3 87 78 28
8D 43 10 F5 C7 BD 68 F6 11 08 68 DC FF 96 D8 C6
AC 7F 2F 1E 09 EF 80 33 ED 1D 91 CE D7 D8 92 41
58 9D 4F AA C4 9E 28 DD 53 BE E6 69 EC 08 86 3F
41 CB B5 48 1A 60 07 26 0B D5 1D E0 2F A4 B1 2E
23 EC 78 D8 F9 0C E9 FC 61 BD D8 B3 B4 09 CF 9A
Output
409CF9A
What I wanted to see was the whole data as a string stored in buf.