hlow all ,
iam begin in c programming so i need your advice
i have sample.txt
Code:
308201a1a0108009090318035
i want to read the file and get substr start 1 to 3 character from that file
this my code but this still error
Code:
pFile = fopen(szFileName, "r"); char ch ;
while ( 1 )
{
ch = fgetc ( pFile ) ;
if ( ch == EOF )
break ;
printf ( "%c", ch ) ;
char *to = (char*) malloc(6);
strncpy(to, from+0, 3);
printf("\nopening file: %s !", to);
}
fclose ( pFile ) ;
i want get output like this
any one can help me for fix this code
thx for your advice and help
br\\zvtral