重学C++ 指向常量数据的非常量指针
2013-04-20 21:48
162 查看
//源码来自《C》
#include<iostream> using std::cout; using std::endl; void printCharacters(const char*); int main() { char phrase[]="characters and $32.98"; // cout<<"The phrase before conversion is:"<<phrase<<endl; printCharacters(phrase); // cout<<"The phrase after conversion is:"<<phrase<<endl; return 0; } void printCharacters(const char* phrase) { while(*phrase!='\0') { cout<<*phrase; phrase++; } }
相关文章推荐
- 重学C++ 指向常量数据的常量指针
- [C++基础]018_常量指针和指向常量的指针
- 常量数据在C#,C++和C中的意义和区别
- The New C++ -- 基本数据类型和字面值常量 (1)
- The New C++ -- 基本数据类型和字面值常量 (3. sizeof表达式和typeid表达式)
- The New C++ -- 基本数据类型和字面值常量 (4. 字符型和字符字面值常量)
- C++之指向数据成员的指针和指向成员函数的指针
- C++之指向数据成员的指针和指向成员函数的指针
- C++中 常量引用、指向常量的指针、常量指针的区别
- C/C++中,内存中数据存储分成4个区:堆、栈、全局/静态存储区和常量存储区。
- C++指向常量的指针和常指针
- C++ 指向成员的指针(数据成员指针,函数成员指针)
- The New C++ -- 基本数据类型和字面值常量 (7. 浮点型和浮点字面值常量)
- C++ 常量数据成员、静态数据成员、常量静态数据成员的初始化
- C++系列之基本数据类型、常量、变量、const、引用、typedef、枚举、类类型、编写自己的头文件
- C++ 常量数据成员、静态数据成员、常量静态数据成员的初始化
- C++之类内不同的数据成员类型以及方法(静态,const,引用,常量引用)
- static 常量区 数据区 堆栈 生命周期 作用域 c++ 以及脚本语言的区别
- C++中对常量指针和 指向常量的指针等组合声明的理解
- c++数据类型--文字常量、变量