hi all,
I want to convert a string contain hex format '0x15' and what to convert it integer because i want to write data contain by a integer variable in hex format (binary data) into the file.
here is my code
char * str = "0x15";
int value;
FILE FILE *fptrSample = fopen("e:\\sample.txt","rb+");
if (fptrSample)
{
value = atoi(str);
putc(value,fptrSample);
fclose(fptrSample);
}
after executing this
output is
value = 0
where as i want to the correct output
value = 0x15
can any one help me?.................