C++ 기본틀 c와 달리 stdio.h 헤더파일이 아닌 iostream 을 전처리지시자를 이용하여 사용한다. using namespace std; 는 namespace std에 포함된 모든 메서드들을 사용하겠다는 뜻으로 std::cout << "hello wor
중복된 내용의 변수를 몇 십개, 몇 백개 선언하는 것은 비효율적이다.이럴때 사용할 수 있는 것이 배열이다.위 코드의 경우 하나의 변수에 10개의 값을 입력할 수 있게 된다.배열 안에 있는 각각의 값들, 변수는 요소라고 하며 개별 접근을 하기 위해서는 배열 이름에 \[]
포인터는 주소값을 담을 수 있는 변수이다.왜 사용을 하는가? 사용 영역에 벗어난 경우에도 메모리에서 주소를 참조하여 값을 변경할 수 있다.main 함수가 아닌 다른 함수에서 값을 변경하고자 할 때 쓰인다.b의 주소값을 포인터변수 a에 넣어 a를 변경하면b또한 변경이 되