C언어 문자열 복사

1. basics string의 정의 string은 배열의 끝이 \0으로 끝나는 character array이다. string의 끝에는 항상 보이지 않는 \0이 숨겨져 있다는 것을 기억해야 한다. 그러므로 "hello" 5 bytes가 아니라 6 bytes를 차지하고 있다. char constant (문자 상수) char constant (문자 상수)는 compile time 동안 ascii number로 대체된다. x = 'a'; // The compiler changes above to x = 97; // 97 is the ascii number of 'a' string constant (문자열 상수) string constant (문자열 상수)는 compile time 동안 저장된 주소로 대체된다...
oneonlee
'C언어 문자열 복사' 태그의 글 목록