본문 바로가기 메뉴 바로가기

Persistence

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Persistence

검색하기 폼
  • 분류 전체보기 (360)
    • 공부일지(TIL) (137)
      • JavaScript (36)
      • JS Framework + Library (43)
      • CSS (8)
      • Web (16)
      • Error case (10)
      • Others (24)
    • Java (40)
    • Python (8)
    • SQL (11)
    • Data Structure & Algorithm (33)
    • TIL (106)
    • Other Stuff (22)
  • 방명록

malloc (1)
[C언어] 문자열 복사와 메모리 해제

문자열 복사하기 #include #include #include #include int main(void) { char *s = get_string("s: "); // leo char *t = s; t[0] = toupper(t[0]); printf("s: %s\n, s"); // Leo printf("t: %t\n, t"); // Leo } t에 s를 할당하고, t의 첫글자를 uppercase로 바꾸고 난 뒤 t와 s를 출력하면 두 개 모두 첫글자가 대문자로 출력된다. 왜냐하면 t는 s가 갖고 있는 주소를 가리키고 있기 때문이다. 즉 s가 갖는 주소에 있는 값이 변하면, t도 동일한 것을 보고 있으므로 역시 똑같이 변한 값이 출력된다. #include #include #include #include i..

공부일지(TIL)/Others 2021. 2. 22. 18:20
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 자바
  • 인스턴스
  • rxjs
  • react
  • 제네릭스
  • 깃
  • Conflict
  • SQL
  • GIT
  • c언어
  • JavaScript
  • 포인터 변수
  • package.json
  • oracle
  • 알고리즘
  • 개발 공부
  • getter
  • useEffect
  • Java
  • Data Structure
  • jQuery
  • 리덕스
  • linkedlist
  • til
  • CSS
  • Prefix Sums
  • this
  • Session
  • Redux
  • youtube data api
more
«   2025/08   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바