b 값을 100으로 예상했지만 12가되었습니다. 왜 그런가요? 분명히 내 c = b
라인이 b에 대한 별칭으로 c를 지정하지 않고 있습니까?두 번째 변수에 대한 참조 설정
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a = 4;
int b = 12;
int& c = a;
c = 8;
cout << a << endl;
c = b;
c = 100;
cout << b << endl;
int bb;
cin >> bb;
return 0;
}