暗恋的滋味
暗恋以来,我的生活很幸福,每天心中都有一个人,这个人不是用来意淫的,而是用来憧憬的。憧憬着明天能够在街上碰巧遇到她,然后和她一起在微风中的晚夏夜共进晚餐,而后就是送她回家。最关键的是我回到了自己的家。这一点很重要。回哪里?回谁的家?这直接能够定义是意淫还是憧憬。
登录
注册
全站
当前博客
空间
博客
好友
相册
留言
const关键字的internal linkage属性
收藏
当将const关键字用于声明某个常量时,该标识符自动具备internal linkage属性,即只对相同文件内的函数可见,对其他文件中的函数是不可见的。这可以通过如下的示例程序证明
//
const1.cpp
#include
<
iostream
>
using
namespace
std;
const
int
a
=
1
;
void
funcA()
...
{
cout
<<
"
cout int A in file const2.cpp have value of
"
<<
a
<<
endl;
}
//
const2.cpp
#include
<
iostream
>
using
namespace
std;
const
int
a
=
2
;
extern
void
funcA();
void
funcB()
...
{
cout
<<
"
cout int A in file const2.cpp have value of
"
<<
a
<<
endl;
}
int
main()
...
{
funcA();
funcB();
}
编译并执行
g
++
const1.cpp const2.cpp
.
/
a.
out
输出结果
cout
int
A
in
file const2.cpp have value of
1
cout
int
A
in
file const2.cpp have value of
2
发表于 @
2007年06月09日 09:37:00
|
评论(
loading...
)
新一篇: constructor的细节之处
|
旧一篇: 《Thinking in Java 4th》1~13章读书摘要
用户操作
[即时聊天]
[发私信]
[加为好友]
Love Katherine
订阅我的博客
文章分类
C++
C语言
GNU/Linux
Java
Qt
读书笔记
他山之石
小程序
业余翻译者
收藏
不谈技术
帅气无边的猪
大牛的地盘
C++的罗浮宫
负暄琐话
(RSS)
存档
2008年06月(3)
2008年04月(5)
2008年03月(7)
2008年02月(6)
2008年01月(6)
2007年12月(2)
2007年11月(7)
2007年10月(1)
2007年09月(12)
2007年08月(4)
2007年07月(1)
2007年06月(6)
2007年05月(3)
2007年04月(20)
2007年03月(10)
2007年02月(3)
2007年01月(2)
软件项目交易