user-0 提问: 我用fread读一个文件，但是出错了。。

回复:
user: user-0
content: 引用 4 楼 zhao4zhong1 的回复:纠正上帖： UINT64 start_time = 0ui64,end_time = 0ui64,duration = 0ui64,ack_time = 0ui64;  大神 谢谢你。。 真正的牛人啊。。 小弟我自觉C语言已经学的不错了 但是现在才发现还是才疏学浅。。 散分了 谢了大神。。

user: user-1
content: 纠正上帖： UINT64 start_time = 0ui64,end_time = 0ui64,duration = 0ui64,ack_time = 0ui64;

user: user-1
content: UINT64 start_time = 0ui64,end_time = ui640,duration = ui640,ack_time = ui640; 常量也有类型！ C++ Integer Constants Integer constants are constant data elements that have no fractional parts or exponents. They always begin with a digit. You can specify integer constants in decimal, octal, or hexadecimal form. They can specify signed or unsigned types and long or short types.  Syntax  integer-constant :  decimal-constant integer-suffixopt octal-constant integer-suffixopt hexadecimal-constant integer-suffixopt 'c-char-sequence'  decimal-constant :  nonzero-digit decimal-constant digit  octal-constant :  0 octal-constant octal-digit  hexadecimal-constant :  0x hexadecimal-digit 0X hexadecimal-digit hexadecimal-constant hexadecimal-digit  nonzero-digit : one of  1 2 3 4 5 6 7 8 9  octal-digit : one of  0 1 2 3 4 5 6 7  hexadecimal-digit : one of  0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F  integer-suffix :  unsigned-suffix long-suffixopt long-suffix unsigned-suffixopt  unsigned-suffix : one of  u U  long-suffix : one of  l L  64-bit integer-suffix :  i64  To specify integer constants using octal or hexadecimal notation, use a prefix that denotes the base. To specify an integer constant of a given integral type, use a suffix that denotes the type.  To specify a decimal constant, begin the specification with a nonzero digit. For example:  int i = 157;   // Decimal constant int j = 0198;  // Not a decimal number; erroneous octal constant int k = 0365;  // Leading zero specifies octal constant, not decimal  To specify an octal constant, begin the specification with 0, followed by a sequence of digits in the range 0 through 7. The digits 8 and 9 are errors in specifying an octal constant. For example:  int i = 0377;   // Octal constant int j = 0397;   // Error: 9 is not an octal digit  To specify a hexadecimal constant, begin the specification with 0x or 0X (the case of the “x” does not matter), followed by a sequence of digits in the range 0 through 9 and a (or A) through f (or F). Hexadecimal digits a (or A) through f (or F) represent values in the range 10 through 15. For example:  int i = 0x3fff;   // Hexadecimal constant int j = 0X3FFF;   // Equal to i  To specify an unsigned type, use either the u or U suffix. To specify a long type, use either the l or L suffix. For example:  unsigned uVal = 328u;             // Unsigned value long lVal = 0x7FFFFFL;            // Long value specified                                    //  as hex constant unsigned long ulVal = 0776745ul;  // Unsigned long value

user: user-1
content: printf里面的%和变量的一一对应关系 scanf里面的%和变量以及变量前加不加&的一一对应关系 是C代码中非常容易出错的地方，而且通常编译还不出错。 所以在编译源代码之前值得专门仔细检查一遍甚至多遍。 int _tmain(int argc, _TCHAR* argv[]) {     LARGE_INTEGER m_lOffset;     UINT32 sample_id = 0,extensions = 0,data_size = 0;     UINT64 start_time = 0,end_time = 0,duration = 0,ack_time = 0;      FILE *fd = NULL;     char *buf = NULL;      fd = fopen("C:\\Users\\sun\\Desktop\\data\\audio", "rb");     if (fd == NULL)         return -1;      printf("UINT64 = %d\n",sizeof(UINT64));     while (1)     {         fread(&start_time, sizeof(UINT64), 1, fd);         if (feof(fd))         {             break;         }         printf("start_time(%I64u)",start_time);         fread(&end_time, sizeof(UINT64), 1, fd);         if (feof(fd))         {             break;         }         printf("end_time(%I64u)", end_time);         fread(&duration, sizeof(UINT64), 1, fd);         if (feof(fd))         {             break;         }         printf("duration(%I64u)", duration);         fread(&extensions, sizeof(UINT32), 1, fd);         if (feof(fd))         {             break;         }         printf("extensions(%u)", extensions);         fread(&data_size, sizeof(UINT32), 1, fd);         if (feof(fd))         {             break;         }         printf("data_size(%u)\n", data_size);         buf = (char *)malloc(data_size);         fread(buf, data_size, 1, fd);         if (feof(fd))         {             break;         }     printf("start_time(%I64u),end_time(%I64u),duration(%I64u),extensions(%u),data_size(%u)\n",             start_time,end_time,duration,extensions,data_size);         free(buf);         buf = NULL;         Sleep(2000);     }     fclose(fd);     return 0; }

user: user-2
content: debug的时候监视end_time变量