- 博客(5)
- 资源 (9)
- 收藏
- 关注
转载 内存对齐问题
什么是内存对齐 考虑下面的结构: struct foo { char c1; short s; char c2; int i; }; 假设这个结构的成员在内存中是紧凑排列的,假设c1的地址是0,那么s的地址就应该是1,c2的地址就是3,i的地址就是4
2007-03-20 13:23:00 920
原创 python中的函数参数传递
函数需要多个参数,可用一个squence代替所有参数,实参前加*>>> range(1,20,3)[1, 4, 7, 10, 13, 16, 19]>>> arg = (1,20,3)>>> range(*arg)[1, 4, 7, 10, 13, 16, 19] 多个Keyword Arguments可用一个dictionary代替,实参前加**>>> def f(**arg
2007-03-17 09:27:00 984
原创 摘抄的笔记,很乱
1.模板中不允许自动类型转换,每个参数必须完全匹配其类型。自动类型转换只用于普通函数。2.当其他的条件都相同时,c++的重载机制会优先选择non-template function,而不选择由template function实例化的函数实体。然而,调用函数的时候也可以使用empty template argument list来告诉编译器只从template实例中选择被调用的对象。3.对
2007-03-17 09:25:00 1298
原创 一些颜色的RGB值
1 白色 #FFFFFF 2 红色 #FF0000 3 绿色 #00FF00 4 蓝色 #0000FF 5 牡丹红 #FF00FF 6 青色 #00FFFF 7 黄色 #FFFF00 8 黑色 #000000 9 海蓝 #70DB93 10 巧克力色 #5C3317 11 蓝紫色 #9F5F9F 12 黄铜色 #B5A642 13 亮金色 #D9D919 14 棕色 #A67D3D
2007-03-17 09:22:00 6268
原创 关于“优雅”的设计
每当遇到优秀的的设计或解决方案我的第一反应总是想用“优雅”这个词来形容。我认为所谓优秀的,完美的,经典的等等都不能贴切的形容一个好的设计。一个好的设计不在于运用了多少编程技巧,也不在于实现了四行就能算到圆周率小数点后500位之类的精妙算法,而是在于简单有效的实现方案,让人看过之后觉得那简直是显而易见的实现方式。简单有效意味着健壮性,可维护性,可扩展性,这些对于软件都是至关重要的。 要做出
2007-03-17 09:21:00 1093
the Art of game design 2nd.Edition
2016-12-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人