yii 学习笔记四 、布局模版设置
2014-04-03 15:24
453 查看
C++ syntax is complex and counter-intuitive. Here is the code to help me understand const.
#include <stdio.h> /* * const data */ void constData(const char *arg) { // can't be compiled // *arg = 'A'; arg = "A"; } void constPointer(char * const p) { // can't be compiled // p = "A"; *p = 'A'; } /* * argv is a pointer array. The pointers in the array are const. */ void constPointerArray(char *const argv[]) { // can't be compiled // *argv = "A"; *(*argv) = 'x'; argv = NULL; } int main(int argc, const char *argv[]) { char str1[] = "abc"; char str2[] = "123"; char *pp[2]; *pp = str1; *(pp+1) = str2; constData(str1); printf("%s\n", str1); constPointer(str1); printf("%s\n", str1); constPointerArray(pp); printf("%s\n", *pp); printf("%s\n", *(pp+1)); return 0; }
相关文章推荐
- PHP中try{}catch{}的具体用法详解
- HHVM 是如何提升 PHP 性能的?
- 浅析PHP 数据库抽象层(PDO)数据对象详解
- php--得到我们开始使用php前的一些参数:变量 / 常量 / 模块 / 函数 / 类
- PHP运行出现Notice : Use of undefined constant 的解决办法
- PHP 最大化资源配置 Resource Limits 错误两则
- php Notice: Undefined index 错误提示解决方法
- yii 学习笔记三 、yii框架基础流程和控制器及父类分析
- 建立Ftp站点
- php--xdebug安装失败
- ntp时间服务器
- PHP5.5新特征以及有可能的版本差异
- php ajax 简单应用
- 【php】读文件找出特定字符
- yii filter自定义过滤器类的用法
- ZenCart新增加静态化页面
- php数组与字符串转换
- php数组与字符串转换
- H.264 基础及 RTP 封包详解
- Zend Studio / Ecliplse插件StartExplorer