magicat
2013年7月30日 星期二
GDB: Missing separate debuginfos
Fixed GDB: Missing separate debuginfos
1. 修改 /etc/yum.repos.d/CentOS-Debuginfo.repo, set enabled=1
2. yum install yum-utils
3. debuginfo-install glibc
如果還是不行更新 gdb and glibc
yum install gdb* glibc*
參考:
http://stackoverflow.com/questions/10389988/missing-separate-debuginfos-use-debuginfo-install-glibc-2-12-1-47-el6-2-9-i686
2012年10月17日 星期三
Translate int to string
#include
<
iostream
>
#include
<
string
>
#include
<
sstream
>
using
namespace
std;
string
int2str(
int &
);
int
main(
void
)
{
int
i = 123;
string
s;
s = int2str(i);
cout << s << endl;
}
string
int2str(
int
&i)
{
string
s;
stringstream ss(s);
ss << i;
return
ss.str();
}
2012年10月16日 星期二
判斷奇偶數
利用位元運算來判斷奇偶數
if
( (
value
&
1
)
==
0
)
cout
<<
"偶數"
;
else
cout << "奇數";
2012年8月20日 星期一
數學符號表
http://zh.wikipedia.org/wiki/%E6%95%B0%E5%AD%A6%E7%AC%A6%E5%8F%B7%E8%A1%A8
2012年7月3日 星期二
C/C++ 中的括號
在 C語言中的括號分別化表
{ } 大括號表示函式本體的開始與結束
( ) 小括號在函式的宣告中使用
大括號的另類用法,
指定了變數的作用範圍,在大括號中的變數都是局部變數,有效區域只在大括號中有效。有效利用這個特性可以使程式簡單明白。
int a = 5;
{
int a = 2;
printf("Here a=%d!!\n", a);
}
printf(" a=%d!!\n", a);
較新的文章
較舊的文章
首頁
訂閱:
文章 (Atom)