#include <stdio.h>
 int main(int AC, char **AV)
{
    FILE *fd = fopen("data", "w+");
    fprintf(fd, "%x%c", 0x41, '1');
    fseek(fd, 0, SEEK_SET);
    int n;
    fscanf(fd, "%d", &n);
    fseek(fd, 0, SEEK_SET);
    char s[4];
    int c = fread(s, 1, sizeof(s), fd);
    s[c] = '\0';
    printf("%d, %s\n", n, s);
    fclose(fd);
    getchar(); 
} 

转自http://www.dutor.net/index.php/2010/10/format-stdio/

相关文章:

  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-11-08
  • 2021-04-24
  • 2021-11-12
  • 2021-12-20
猜你喜欢
  • 2021-07-21
  • 2022-12-23
  • 2022-02-22
  • 2021-11-21
  • 2022-12-23
  • 2021-11-02
相关资源
相似解决方案