1、bigint占用8个字节
有符号数范围:
-9223372036854775808 9223372036854775807
无符号数范围:
0 18446744073709551615
2、通过绿色工具打开表直接输入18446744073709551615保存不上,只能通过SQL语句保存
3、sql语句中可以使用整数常量
update table set cmd = cmd & (1 << n),其中的1,MySQL会自动解析为64位的,因此不必担心越界问题
4、在vc中使用64位整数相关的类型和函数
__int64, unsigned __int64;
__int64 _atoi64( const char *string );
char *_i64toa( __int64 value, char *string, int radix );
char * _ui64toa( unsigned _int64 value, char *string, int radix );
注意在vc中使用常量64位数就不能直接写数字了
__int64 nCmd = 0xFF;
nCmd = nCmd & (1 << n);
其中,直接写1的话,不对,编译器为认为是16位的1,可以显式定义一个变量__int64 nMask = 1;然后使用nMask:
nCmd = nCmd & (nMask <<n);