1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
using namespace std;
void main() {
int a[2][3] = { 6, 5, 4, 3, 2, 1 };
int i, j;
int(*p)[3];
p = a; //초기화
for ( i = 0; i < 2; i++)
{
for ( j = 0; j < 3; j++)
{
cout << a[i][j] << "\t " << p[i][j] << "\n ";
cout << *(a[i] + j) << "\t " << *(p[i] + j) << "\n ";
cout << *(*(a + i) + j) << "\t " << *(*(p + i) + j) << "\n";
}
}
}
|
cs |
'Programming > [C++]' 카테고리의 다른 글
[C++] pointer (포인터) (0) | 2018.03.21 |
---|---|
[C++] 콜론 초기화 (0) | 2018.03.21 |
[C++] Template(템플릿) (0) | 2018.03.21 |
[C++] Template 함수 (템플릿 함수) (0) | 2018.03.21 |
[C++] Template Class (템플릿 클래스) (0) | 2018.03.21 |