C
abcdcb
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C语言 将时间转换成指定格式的字符串
需要用到得库文件 #include #include #include #include 为了方便理解,定义bool类型 typedef short bool; #define true 1 #define false 0 获得系统当前时间 struct tm* fun_tm_now( void ) { time_t t_no原创 2012-08-23 14:37:45 · 2150 阅读 · 0 评论 -
深入C语言数据类型转换
我想,大家都常常听人提及,C语言指针的重要性吧,但它重要在哪儿,你们有想过吗? 我们来看一个简单的例子: int i = 256; char *a = (char *)&i; printf("%d,%d,%d,%d\n",*a,*(a+1),*(a+2),*(a+3)); 这个例子输出的是 0,1,0,0 (32位及其以上操作系统下) 为什么会是这样一个结果呢? 变量 i 在内存原创 2012-11-16 11:05:06 · 1761 阅读 · 0 评论 -
c中不适用任何算法,就能使用map
首先,我要说明,该方法正在测试当中,还不完善。在文章最后,我留下了2个问题,欢迎大家讨论。 思路:利用地址作索引。 代码如下: #include #include #define UL(x) (unsigned long)(x) int main(void) { char* *map = (char **)malloc(4.4E9); map[UL("我")] = "哈哈,蛋原创 2013-04-17 17:56:55 · 1504 阅读 · 0 评论
分享