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
37
󻞳󼩘󽴔󻫗󻳫
󻞳󼩘󽴔󻫗󻳫
문자열로 식별되는 키(key)에 해당하는 문자열 값(value)을 저장하는 소프트
웨어 모듈을 구현하려고 한다. 윈도우의 레지스트리(registry)와 유사한 기능을
구현하려고 하는 것이다. 핵심에 집중하기 위해 다음의 코드에는 키 간 계층
관계를 배제하였으며, 레지스트리 요소를 만드는 함수만 다룰 것이다.
󺳗󻺏󻝳󼞇󺹻
/*
레지스트리
키
핸들
*/
typedef struct Key* RegKey;
/* 'key
_
name'
으로
식별되는
새로운
레지스트리
키
생성
*/
RegKey createKey(char* key
_
name);
/*
값
'value'
를
레지스트리
'key'
에
저장
*/
void storeValue(RegKey key, char* value);
/* 'key'
를
등록하여
읽을
수
있도록
한다
.
(
다른
함수들은
이번
예제에서
제외
) */
void publishKey(RegKey key);
󺳗󻺏󻝳󼞇󺹻󽴔󺈻󼫓
#define STRING
_
SIZE 100
#define MAX
_
KEYS 40
struct Key
{
char key
_
name[STRING
_
SIZE];
char key
_
value[STRING
_
SIZE];
};
/*
전체
레지스트리
키를
보유하는
배열
(
파일
내
전역
변수
) */
static struct Key* key
_
list[MAX
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