notes of C++
来源:互联网 发布:知彼网络 编辑:程序博客网 时间:2024/05/23 13:35
1* using namespace std;
had better used in .cpp file but not in .h file
namespace like a space which can contain class/variable/function and so on
1)create a namespace
namespace demo{
int i,j;
content....
}
2)use a namespace which exists in below two ways
(1)
using namespace demo
void test()
{
cout< }
(2)
void test()
{
cout< }
2* head file standard
#ifndef _XXX_H_
#define _XXX_H_
...some declaration
#endif
3* ram leakage And ram patch
ram leakage: because don't free() after malloc() , or don't delete() after new()
:error operate and must be avoid
ram patch: because frequently free() and malloc() or delete() and new()
:normal but must be consider
4* transmit parameter
1)by value
like: int a; b(a); //b() is a function use a as one formal parameter
the value of a's change in b() will not affect the value of a out of b();
2) by quote
like : void b(int &temp);
int a;b(a);//the change of a in b() will affect the value of a out of b().
3)by pointer
like : void b(int * temp);
int a;b(&a);//the change of a in b() will affect the value of a out of b().
had better used in .cpp file but not in .h file
namespace like a space which can contain class/variable/function and so on
1)create a namespace
namespace demo{
int i,j;
content....
}
2)use a namespace which exists in below two ways
(1)
using namespace demo
void test()
{
cout< }
(2)
void test()
{
cout<
2* head file standard
#ifndef _XXX_H_
#define _XXX_H_
...some declaration
#endif
3* ram leakage And ram patch
ram leakage: because don't free() after malloc() , or don't delete() after new()
:error operate and must be avoid
ram patch: because frequently free() and malloc() or delete() and new()
:normal but must be consider
4* transmit parameter
1)by value
like: int a; b(a); //b() is a function use a as one formal parameter
the value of a's change in b() will not affect the value of a out of b();
2) by quote
like : void b(int &temp);
int a;b(a);//the change of a in b() will affect the value of a out of b().
3)by pointer
like : void b(int * temp);
int a;b(&a);//the change of a in b() will affect the value of a out of b().
0
上一篇:define function pointer
下一篇:My start of git
相关热门文章
- test123
- 编写安全代码——小心有符号数...
- 使用openssl api进行加密解密...
- 一段自己打印自己的c程序...
- sql relay的c++接口
- linux dhcp peizhi roc
- 关于Unix文件的软链接
- 求教这个命令什么意思,我是新...
- sed -e "/grep/d" 是什么意思...
- 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
评论热议
0 0
- Notes of Shell command
- Some Notes of QT4
- notes of Accelerate C++
- Notes of ubuntu
- Reading Notes of SICP_01
- Notes of operating system
- Notes of Dense Trajectory
- Notes of Inline Assembly
- Notes of Writing paper
- notes of C++
- NOTES of "effective STL"
- notes of Effective C++
- Notes of Go
- Notes of Daily Work
- Notes of Python
- greedy algorithms notes of Date Structure and Algorithms Analysis in C
- Notes of Visual C++ 6.0
- Notes of Leanring Desing patterns
- shell 编程语法总结(I/O 逻辑控制结构)
- My understand of stack and queue
- My understand of KMP describe in C
- My first CXX problem:"aggregate has incomplete type and cannot be defined"
- define function pointer
- notes of C++
- My start of git
- 对搜索引擎的初了解发展及核心框架
- 搜索引擎之网络爬虫
- my makefile for CPP v2.0
- 常见ddl无刷联动效果
- JAVA 中 extends 与 implements 的前世今生
- QT学习之路
- MySQL的简单count查询(无where子句)
原创粉丝点击
热门IT博客
热门问题
老师的惩罚
人脸识别
我在镇武司摸鱼那些年
重生之率土为王
我在大康的咸鱼生活
盘龙之生命进化
天生仙种
凡人之先天五行
春回大明朝
姑娘不必设防,我是瞎子
安琪拉蓝不够用怎么办
甄姬蓝不够用怎么办
渲染很暗怎么办
投影仪镜头模糊怎么办
羽毛球拍掉磅 怎么办
父亲理解力很差怎么办
地磅坑人怎么办
steam反作弊怎么办
Win10开始菜单打不开怎么办
战地1被咬尾怎么办
网页缓慢怎么办
彩虹六号挂机怎么办
桌面图标点不开怎么办
笔记本没电打不开机怎么办
高速上没油了怎么办
窗户边脏了怎么办
世界rpg死了怎么办
stem被误封怎么办
hp打印机不吸纸怎么办
hp复印机不吸纸怎么办
惠普m1005卡纸怎么办
打印机显示电话怎么办
hpm1136漏墨怎么办
二保焊收弧有气孔怎么办
跑不动怎么办
高校邦孙子兵法怎么办?
军事理论网课挂科怎么办
军事理论挂科怎么办
军事理论没去考怎么办
脸部增生疤痕怎么办
tprk 出现haze怎么办
眼角膜水肿怎么办
眼水肿怎么办
眼睛角膜水肿怎么办
眼角膜一直水肿怎么办
儿童角膜水肿怎么办
小孩角膜水肿怎么办
糖尿病人腿疼怎么办
cart治疗复发怎么办
腹部不会用力怎么办
大檐帽大了怎么办