-
[C] 배열의 주소공부/C, C++ 2021. 8. 29. 00:50
1차원 배열의 이름은 그 배열의 주소의 주소와 동일하기 때문에 scanf로 입력받을 시, 주소 연산자(&)를 붙이지 않는다.
str, &str 출력: 같은 값을 가지는 것을 확인함
str + 1, &str + 1 출력: str + 1은 배열 타입(char)의 크기만큼 증가, &str + 1은 배열 타입(char) * 배열의 크기만큼 증가'공부 > C, C++' 카테고리의 다른 글
[C++] 공백으로 문자열 자르기, for each문 (나중에 포스트 하기) (0) 2022.03.18 [C++] string 공백 포함 입력, 입력 버퍼 비우기 (0) 2022.01.31 [C++] sort( )를 이용한 구조체 정렬 (0) 2022.01.12 [C++] vector에 원소 추가하기 (0) 2021.10.10 [C++] struct형의 vector를 함수 인자로 넘기기 (0) 2021.10.08