[an error occurred while processing this directive]
|
#include int symx; void main(void){ myout = fopen ("x.bin", "w"); else{ symy=symx&0x0F; i=0; //return(0);
E-mail:
info@telesys.ru
#include
#include
int symy=0;
char i=0;
FILE *myout;
FILE *stream;
if((stream= fopen("x.hex","r")) == NULL){
printf("cannot open input file \n The file name x.hex\n");
exit(1);
}
if(myout == NULL) {
printf("cannot create output file\n The file name x.hex\n");
exit(1);
}
while((symx=fgetc(stream)) != EOF){
//if((symx!='\n') || (symx!='\r') )
if(symx=='\n') continue;
if(symx=='\r') continue;
if( (symx >= '0') && (symx <= '9') )
{
//printf("%c\n", symx);
symx-='0';
}
else
if ( (symx <= 'f') && (symx >= 'a') )
{
//printf("%c\n", symx);
symx -= 'a';
symx += 0x0a;
}
printf("error in letters\n");
}
if(i==0)
{
i=1;
}
else{
symy=(symy<<4)+(symx&0x0f);
fputc(symy, myout);
}
}
//fseek(stream, offset, SEEK_SET);
fclose(stream);
fclose(myout);
}
Ответы
Перейти к списку ответов
|||
Конференция
|||
Архив
|||
Главная страница
|||
Содержание