码迷,mamicode.com
首页 >  
搜索关键字:unsigned    ( 4409个结果)
VLine[-1]=VLine[width]=128 数组的负一地址代表啥
最近在调算法是,涉及到rgb转yuv数据的一个函数,出现了这种常见错误:如下unsigned char *VLine = (new unsigned char[width+2]);//+1; //ULine[-1]=ULine[width]=128; //-1的16位二进制表示:1111 1111 ...
分类:其他好文   时间:2014-07-16 17:47:18    阅读次数:215
[整理]C结构实现位段(bit field)
#include #include typedef struct A{ int a:5; int b:3; unsigned c:8; unsigned d:8;} Type_A;/* VS2010, Windows XP, Debug模式下运行 */int main(void){ struc...
分类:其他好文   时间:2014-07-16 16:47:14    阅读次数:210
warning: integer constant is too large for 'long' type"
时间 :2014-7-11 11:38 调试iHealthGateway和云通信时发现问题(时间戳TS)问题:Linux编译时候定义了一个unint64_t = 1405043216129 (64位unsigned long long int 取值范围之内) 但编译的时候总是出现warnin...
分类:其他好文   时间:2014-07-16 15:37:18    阅读次数:245
_?_?i?n?t?6?4? ?与?l?o?n?g? ?l?o?n?g? ?i?n?t
在做ACM题时,经常都会遇到一些比较大的整数。而常用的内置整数类型常常显得太小了:其中long 和 int 范围是[-2^31,2^31),即-2147483648~2147483647。而unsigned范围是[0,2^32),即0~4294967295。也就是说,常规的32位整数只能够处理40亿...
分类:其他好文   时间:2014-07-16 13:41:17    阅读次数:187
Bit operator: Left shift and Right shift (Signed or unsigned? )
No matter left shift or right shift, the result's sign should always be the same as its left operand. By default, const numbers in C/C++ is signed. -Wsign-compare {      unsigned int j = 3;      ...
分类:其他好文   时间:2014-07-16 12:59:21    阅读次数:238
位字段
1. 位字段(bit field)是一个signed int或unsigned int中一组相邻的位(C99还允许_Bool类型位字段)。C使用unsigned int作为给位字段结构分配内存空间的基本单位。位字段由一个结构声明建立,该结构声明为每个字段提供标签,并决定字段的宽度。例如,以下声明建立...
分类:其他好文   时间:2014-07-16 12:24:56    阅读次数:219
iOS常用的加密算法
在iOS开发中,为了数据的安全经常对内容进行加密,在这儿我们对常用的加密算法进行了总结: 1、MD5 + (NSString *)md5Hash:(NSString *)str { const char *cStr = [str UTF8String]; unsigned char result[16]; CC_MD5( cStr, strlen(cStr), re...
分类:移动开发   时间:2014-07-14 18:17:16    阅读次数:265
int long long 的取值范围
unsigned   int   0~4294967295   //整型的每一种都有无符号(unsigned)和有符号(signed)两种类型(float和double总是带符号的),在默认情况下声明的整型变量都是有符号的类型(char有点特别),如果需声明无符号类型的话就需要在类型前加上unsigned。无符号版本和有符号版本的区别就是无符号类型能保存2倍于有符号类型的正整数数据。 int  ...
分类:其他好文   时间:2014-07-12 23:24:54    阅读次数:775
写代码时常见的错误
实验室有要做阶段练习题了,其中有一道改bug题:#include #include int main(int, char**) { std::vector** ppRandomData = distributeRandomInt(100); for (unsigned int i=0; i<1000; i++) { if (ppRandomData[i]) { std:...
分类:其他好文   时间:2014-07-12 19:46:35    阅读次数:223
char、signed char、unsigned char的区别
ANSI C 提供了3种字符类型,分别是char、signed char、unsigned charchar相当于signed char或者unsigned char,但是这取决于编译器!这三种字符类型都是按照1个字节存储的,可以保存256个不同的值。不同的是取值范围signed char取值范围是...
分类:其他好文   时间:2014-07-10 16:02:32    阅读次数:286
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!