![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
colorfishes
走别人没走过的路,让别人有路可走
展开
-
关于C语言的memset容易出现的问题
今晚一个关于metset的问题一直调试不出来。部分代码如下:const unsigned int unmarked = 10000;int* diag_map = (int*)malloc(sizeof(int)*(num_rows+num_cols));memset(diag_map,unmarked,sizeof(int)*(num_rows+num_cols));for(i=0;i<n原创 2015-01-12 21:03:09 · 1228 阅读 · 0 评论 -
371. Sum of Two Integers LeetCode OJ
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.既然不能用加法和减法,那么我们只能想到用位运算了,即与(&)或(|)非(~)异或(^)。考虑两个整数(例如原创 2016-07-01 15:33:26 · 282 阅读 · 0 评论