Skip to Content
우아한 C언어 코딩 패턴
book

우아한 C언어 코딩 패턴

by Christoper Preschem, 정기훈(Jung Ki Hun)
April 2024
Beginner to intermediate
364 pages
7h 2m
Korean
Insight
Content preview from 우아한 C언어 코딩 패턴
C
89
󼕃󺹿󻪔󽴔󻺏󻪿
text
=
malloc(size);
readFileContent("my
-
file.txt", text, size);
caesar(text, strnlen(text, size));
printf("Encrypted text: %s\n", text);
/*
여기에서
메모리를
해제하지
않는다
. */
}
}
메모리를 할당하지만 할당 해제를 위한
free
는 호출하지 않는다. 대신 메모리
를 가리키는 포인터가 범위를 벗어나게 하여 메모리 누수를 일으킨다. 하지만
곧바로 프로그램이 종료되고 운영 체제가 메모리를 클린업해주기 때문에 큰
문제가 되지 않는다.
이러한 접근 방식은 다소 세련되지 않아 보이지만, 어떤 경우에는 괜찮은 방
법이다. 프로그램 실행 시간 내내 메모리를 사용하거나 프로그램 실행 시간이
짧고, 코드가 진화하지 않고, 다른 곳에서 재사용되지 않을 것이라고 확신한다
면 메모리 클린업에 신경쓰지 않아도 된다. 이는 개발자의 일을 아주 단순하게
만들어주는 해결책이 될 것이다. 하지만 여러분의 프로그램이 진화하는지 혹
은 실행 시간이 더 길어지는지 유심히 살펴야 할 것이다. 그럴 경우에는 아예
다른 접근 방식을 찾아야 한다.
바로 이어서 이 내용을 다룰 것이다. 두 개 이상의 파일을 암호화하려고 하
거나 현재 디렉터리에 있는 모든 파일을 암호화한다고 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

AI를 위한 필수 수학

AI를 위한 필수 수학

할라 넬슨
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리
개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에
클라우드 네이티브 애플리케이션 디자인 패턴

클라우드 네이티브 애플리케이션 디자인 패턴

카순 인드라시리, 스리스칸다라자 수호티얀

Publisher Resources

ISBN: 9788966264742