指针,static,const,引用,violate等等
来源:互联网 发布:macbook无法下载软件 编辑:程序博客网 时间:2024/06/06 05:23
#include <stdio.h>#include <malloc.h>int main() {char **rlname; //malloc!rlname = (char**)malloc(100 * sizeof(char*) );for (int j = 0; j < 100; j++){rlname[j] = (char*) malloc(30 * sizeof(char) );}//freefor (int j = 0; j < 100; j++){free(rlname[j]);}free(rlname);}
#include <iostream>using namespace std;int main(){int m, n, **p;cin >> m >> n;p = new int*[m];for (int i = 0; i < m; ++i)//for allocate memory{p[i] = new int[n];//*p + i = new int[n];//wrong}//....//Process your program;for (int j = 0; j < m; ++j)//for free the heap memory{delete[]p[j];}delete[]p;}
0 0
- 指针,static,const,引用,violate等等
- const static 指针与引用
- const violate
- C++中指针,引用,const,static总结
- 引用,const引用,指针
- const violate mutuable
- const static 数组指针
- const引用和const指针
- const指针和const引用
- const指针与引用
- 指针 引用 const
- 引用与 const指针
- 总结:指针、引用、const
- const 和 引用 指针
- 指针--引用--const
- C++ 引用、const指针
- const指针的引用
- const 指针和引用
- boost.timer
- 枚举类型enum
- wiplus项目日志
- JavaScript学习笔记 第四记
- Struts2基础标签
- 指针,static,const,引用,violate等等
- QuartusII添加IP核
- Mysql数据库int(1)和tinyint(1)的区别&&扩展阅读(转)
- loadrunner 支持自定义函数
- C/C++中extern关键字详解
- 1006
- spring技术内幕10-Web环境中Spring启动过程
- BLE概念,profile,service,characteristic, UUID
- 黑马程序员【深入理解IO流中字符编码问题】