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언어 코딩 패턴
Fluent
58
󻱴󽴔󽴔󻫳󺸧󽴔󻳤󻇃󽴔󻃧󼬧
createKey
󼨷󻛧󽴔󻗯󻪇
/* 'key
_
name'
으로
식별되는
새로운
레지스트리
생성
.
(NULL
이어서는
안되며
,
최대
STRING
_
SIZE
글자수를
넘을
수
없다
)
키에
대한
핸들을
반환하거나
,
오류가
발생한
경우
NULL
을
반환한다
. */
RegKey createKey(char* key
_
name);
createKey
󼨷󻛧󽴔󺈻󼫓
RegKey createKey(char* key
_
name)
{
assert(key
_
name !
=
NULL);
assert(STRING
_
SIZE > strlen(key
_
name));
RegKey newKey
=
calloc(1, sizeof(struct Key));
if(newKey
==
NULL)
{
return NULL;
}
strcpy(newKey
-
>key
_
name, key
_
name);
return newKey;
}
이제
createKey
함수가 훨씬 간단해졌다. 더 이상 상태 코드 반환을 하지는 않
지만, 그 대신 핸들을 직접 반환하여 이 정보를 반환하기 위한 아웃 파라미터
가 필요없다. API 문서화 작업 역시 추가적인 파라미터에 대한 설명이나 함수
결과가 어떻게 호출자에게 반환되는지에 대한 장황한 설명이 필요하지 않은
만큼 훨씬 간단해진다.
호출자 입장에서도 상황이 훨씬 간단해진다.
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

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

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

오현석, 해리 퍼시벌, 밥 그레고리
클라우드 네이티브 애플리케이션 디자인 패턴

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

카순 인드라시리, 스리스칸다라자 수호티얀
개발 7년차, 매니저 1일차

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

권원상, 한민주, 카미유 푸르니에

Publisher Resources

ISBN: 9788966264742