1.在c中,不要轻易定义变量,很容易造成重复定义的错误。现在一般在.c文件中定义变量,然后在需要使用的地方用extern标注,
就可以在当前文件下使用其他文件中定义好的全局变量。
2.用vs对变量添加监视:要在debug模式下,然后对变量所在的语句打断点,当程序运行到该语句,右击该变量->添加监视,
然后就可以在监视窗口看到该变量的实时的值了。
3.#include <stdint.h>
/* There is some amount of overlap with <sys/types.h> as known by inet code */
typedef signed char int8_t;
typedef short int int16_t;
typedef int int32_t;
# if __WORDSIZE == 64
typedef long int int64_t;
# else
__extension__
typedef long long int int64_t;
# endif
/* Unsigned. */
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
# endif
格式化输出:
unit64_t %llu
unit32_t %u
unit16_t %hu