惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
MyScale Blog
MyScale Blog
博客园 - Franky
The Cloudflare Blog
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
腾讯CDC
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
博客园 - 【当耐特】
美团技术团队
云风的 BLOG
云风的 BLOG

博客园 - Rawu

QT 使用(1) 到广外路线图 假期电话值班问题 test from blogex Event Sample -- from Professional C# DB2数据库中提高INSERT性能详解 [zt] Uwyn C++ Coding Standard 成员模板 class template template base -- Symbian OS C++ for Mobile Phones Volume2 -- hand note [zt]DB2编程小结 写个帖子记录一些小问题。 High-performance SQL Using DB2 routines to ease migration [ICNEWCASTLE]Bad day at the office [ICNEWCASTLE]I'll celebrate! the night before last night 's dream find it for a long time .. PB dddw filter Problem's Solution
const coding style
Rawu · 2006-06-05 · via 博客园 - Rawu

 1#include <iostream>
 2using namespace std ;
 3int main(void)
 4{
 5    int obj1 = 33;
 6    int obj2 = 66;    
 7    int *const cp_nci = &obj1;      // const pt point to nonconst int 
 8    *cp_nci = 56;                    // can modify
 9    //cp_nci = &obj2;                // cannot modify    
10    cout<<cp_nci<<" "<<*cp_nci<<endl;
11    
12    int const *ncp_ci ;              //non const pt point to const int 
13    ncp_ci = &obj1;                    // needn't be initialized
14    //*ncp_ci = 12;                    // cannot modify
15    ncp_ci = &obj2;                    // can modify
16    cout<<ncp_ci<<" "<<*ncp_ci<<endl;
17    
18    int const *const cp_ci  = &obj1 ; //const pt point to const int 
19    //*cp_ci = 90;                      // cannot modify
20    //cp_ci = &obj2 ;                  // cannot modify
21    cout<<cp_ci<<" "<<*cp_ci<<endl;
22    
23}

24