일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 빅 데이타
- 김양재 목사
- No SQL
- nodeJS
- 인공지능
- Statistics
- openCV
- data science
- node.js
- Deep learning
- MongoDB
- probability
- R
- Machine Learning
- 김양재
- 딥러닝
- 몽고디비
- Big Data
- c++
- WebGL
- 우리들교회
- 빅 데이터
- 통계
- 데이터 과학
- 빅데이타
- 확률
- 김양재 목사님
- 빅데이터
- Artificial Intelligence
- 주일설교
Archives
- Today
- Total
Scientific Computing & Data Science
[C/C++] Example / swap: call by reference 본문
// Test-002.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
// fucntions prototype
int factorial( int x);
void swap( int & x, int & y);
int _tmain( int argc , _TCHAR * argv [])
{
int a = 4;
int b = 3;
cout << a << " , " << b << endl;
swap(a ,b);
cout << a << " , " << b << endl;
int c = 25;
cout << hex << c << endl;
return 0 ;
}
int factorial( int x ) {
int fact = 1;
while ( x > 1) {
fact *= x;
x--;
}
return fact ;
}
void swap( int & x, int & y) {
int tmp = x;
x = y;
y = tmp;
}
'Programming > C&C++' 카테고리의 다른 글
[C/C++] Example / Class (0) | 2014.06.12 |
---|---|
[C/C++] Example / Pointer of Structure (0) | 2014.06.12 |
[C/C++] Example / Structure (0) | 2014.06.12 |
[C/C++] Example / Dynamic Array (0) | 2014.06.12 |
[C/C++] Example / swap: call by pointer (0) | 2014.06.12 |
Comments