Learn c++ step by step (轉)
Learn c++ step by step (轉)[@more@]
透過這個例子邊可以看出區別,而且注意一定要用標準C++的樣式
打好基礎
#include
#include
using namespace std;
int add1CallByValue(int t); //define function
void add1ByPointer(int* t);
void add1ByReferrence(int& t);
int main(void)
{
int count=12;
std::cout< add1CallByValue(count); //call by value
std::cout<
std::cout< add1ByPointer(&count); //call by pointer
std::cout<
std::cout< add1ByReferrence(count); //call by referrence
std::cout<
return(0);
}
int add1CallByValue(int t)
{
return(t+1);
}
void add1ByPointer(int* p)
{
*p+=1;
}
void add1ByReferrence(int& t)
{
t+=1;
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10748419/viewspace-963354/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Learn C++ step by step(2) (轉)C++
- 安裝linux(step by step)(轉)Linux
- ClearCase使用入門--step by step(序) (轉)
- [完結] Learn Vue 2: Step By Step [Laracasts 免費影片中文語音]VueAST
- [完結] Learn Vue 2: Step By Step [Laracasts 免費視訊中文語音]VueAST
- React Step by StepReact
- Command 模式 Step by Step模式
- BAPI Step by step GuidanceAPIGUI
- Step by Step TimesTen --- ttIsqlSQL
- Promise的實現(step by step)Promise
- 轉載一個step by step change public-ip and vip on RAC
- Linux Software RAID step by stepLinuxAI
- Git Step by Step (3):Git物件模型Git物件模型
- Oracle高階複製Step by StepOracle
- 單步除錯 step into/step out/step over 區別詳解除錯
- ABP應用開發(Step by Step)-下篇
- ABP應用開發(Step by Step)-上篇
- TIDB DM資料同步step by stepTiDB
- Git Step by Step (4):探索.git目錄Git
- 實時 Linux 抖動分析 Step by stepLinux
- Git Step by Step (6):Git遠端倉庫Git
- STEP BY STEP INSTALL SSH ON AIX5.3(6.1)AI
- install 11G ASM on RedHat step by stepASMRedhat
- oracle10g simpe AQ step by step(二)Oracle
- oracle10g simpe AQ step by step(一)Oracle
- linux中配置NFS服務step by stepLinuxNFS
- step by step install netbackup client 6.5 on aixclientAI
- Step by Step Data Replication Using Oracle GoldenGateOracleGo
- Step by Step 安裝 BizTalk Server 2009Server
- Baby-Step-Gaint-Step演算法詳解AI演算法
- Step-by-step,打造屬於自己的vue ssrVue
- Git Step by Step (7):Git遠端倉庫(續)Git
- Step by Step TimesTen ----- 配置client-server連線clientServer
- Team Foundation Server 2005 (Chs) Setup Step by StepServer
- Linkerd 2.10(Step by Step)—多叢集通訊
- 深度學習之step by step搭建神經網路深度學習神經網路
- 使用RMAN備份集搭建Oracle Dataguard Step by Step(一)Oracle
- 使用RMAN備份集搭建Oracle Dataguard Step by Step(二)Oracle