/* 0-9 减去0x30 A-F 减去0x37
你需要如下转换
char str[2] ={5,6};
5的字是0x35,你char test[0] = char[0] - 0x30
test[0] = test[0] <<4 |(char[1]-0x30)
这样56就可以放到一个字节里面成为0x56了
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int removeWhitespace(char* str) {
int i, j;
for (i = 0, j = 0; str[i] != '\0'; i++) {
if (str[i] != ' ' && str[i] != '\t' && str[i] != '\n') {
str[j++] = str[i];
}
}
str[j] = '\0';
return j;
}
#if 0 //去掉空格
int main() {
FILE* file = fopen("input.txt", "r+");
FILE* file1 = fopen("input_rm_space.txt", "w");
int length_file1 = 0;
if (file == NULL) {
printf("Failed to open the file.\n");
return 1;
}
fseek(fil