반응형

함수명, 변수명 바꾸기


프로그래머가 가장 힘들어하는 일은 이름 짓기라고 한다.

이름을 짓기가 어려운 만큼, 보다 더 좋은 이름이 떠오르면 바꾸고 싶은 생각도 하기 마련이다.

그것은 클래스, 함수, 변수 이름 또한 마찬가지이다.

 

그러나 이미 개발이 많이 진행되어서 기존에 작성한 함수명, 변수명이

여기저기서 많이 쓰이고 있는 상황이라면?

 

아마 모든 이름을 직접 하나씩 변경하려면 어려워서 바꾸는 걸 포기하거나,

모두 바꾸기(Ctrl+Shift+H)를 사용해서 바꾸기를 시도할 것이다.

 

모두 바꾸기의 경우 바꿔야 할 이름 외에도 바꾸면 안되는 이름까지도 바꿔버릴 수 있는데,

자칫하면 컴파일이 안되거나, 사이드 이펙트(Side Effects)가 발생하는 등의 위험이 따르게 된다.

 

Visual Studio에서는 이러한 상황을 대비해서 이름 바꾸기 기능을 지원한다.

Visual Studio 이름 바꾸기 기능을 사용해서 쉽고 안전하게 함수명, 변수명을 한 번에 일괄 변경해보자.

728x90

프로그래머가 가장 힘들어하는 일은? 설문 결과 (출처: ITWORLD)

더보기

프로그래머가 가장 힘들어하는 일은?

  1. 이름 짓기 (49%) - 프로젝트 코드명, 디렉토리명, 파일명, 클래스명, 메소드명, 변수명 ...
  2. 개발 가능 혹은 불가능한 사항 설명하기 (16%) - 화성에서 온 개발자, 금성에서 온 기획자
  3. 개발 작업이 끝나는 시간 산정하기 (10%) - 언제까지 끝나요?
  4. 다른 사람과 함께 일하기 (8%) - PM, 기획자 디자이너
  5. 다른 개발자 코드 작업하기 (8%) - 스파게티 소스
  6. 내가 수긍 못할 기능 구현하기 (3%)
  7. 문서 작성 (2%)
  8. 테스트 작성 (2%)
  9. 해법 찾기 (2%)

Visual Studio 이름 바꾸기 기능


Visual Studio에서 이름 바꾸기 기능을 실행하려면 이름을 바꾸려는 항목(함수명, 변수명)을 캐럿(caret)으로 선택하고
Ctrl+R+R 을 누르거나, 마우스 오른쪽 버튼을 클릭해서 '이름 바꾸기'를 선택하면 된다.

 

'이름 바꾸기' 기능은 Visual Studio 2015 이상에서 도입된 기능으로 Visual Studio 2017, Visual Studio 2019에서도 동일하게 사용할 수 있다.

(Visual Studio 2013 이하에서는 지원하지 않는다.)

 

아래에서 소개하는 내용은 편의상 C++ 코드이지만, C#과 같은 다른 언어에서도 동일하게 사용할 수 있다.

 

함수명, 변수명 일괄 변경하는 방법


1. 바꾸려는 함수명, 변수명을 선택하고 Ctrl+R+R 또는 마우스 오른쪽 버튼 클릭 후 '이름 바꾸기' 선택

함수명/변수명 선택 후 마우스 우클릭하여 '이름 바꾸기' 선택

여기서는 클래스명 AppleClass를 예시로 들것이다.

 

2. '이름 바꾸기' 창에서 '새 이름'란에 변경하고자 하는 이름을 입력하고 '미리 보기' 클릭

이름 바꾸기 창

클래스명 AppleClassBananaClass로 일괄 변경해볼 것이다.

검색 범위는 '전체 솔루션'이 기본인데 일반적인 상황에서는 건드리지 않아도 될 것이다.

 

3. '변경 내용 미리 보기'창에서 변경할 항목을 선택하고 '적용' 클릭

이름 바꾸기의 변경내용. 연관성이 높은 TestNamespace1 네임스페이스는 체크된 반면, TestNamespace2에선 모든 체크가 풀려있다.

(왼쪽) 이름 변경이 필요한 항목들은 자동으로 체크되는 반면, (오른쪽) 다른 네임스페이스에서의 동일한 클래스명은 확인되지 않은 참조로 분류되어 체크가 해제되어 있는 것을 확인(오른쪽)할 수 있다.

Visual Studio가 일정 수준 자동으로 체크를 선택해주긴 하지만, 그래도 한 번 정도는 불필요한 변경 항목이 있는지 확인이 필요하다.

 

4. 이름 바꾸기 완료

AppleClass에서 BananaClass로 성공적으로 이름이 변경되었다.

이로써 BananaClass 클래스명으로 이름 바꾸기가 완료되었다.

만약 이름 바꾸기 후 컴파일 오류가 발생할 경우 Ctrl+Z로 변경 사항을 취소하거나,

문제가 있는 부분을 직접 변경해주면 되겠다.

 

반응형
반응형

문자열 구성 판별


사용자로부터 입력받은 문자열이 유효한지, 문자열이 어떤 문자들로 구성되어 있는지 확인이 필요할 때가 있다.

 

이 경우 직접 문자열 개별 성분들을 하나씩 순회하면서 유효성을 검증하는 파싱 코드를 직접 작성할 수도 있겠지만,

파이썬에서 기본적으로 제공하는 메서드들을 사용하면 개발 시간을 단축시킬 수 있을 뿐만 아니라 안정성 또한 보장된다.

 

그럼 다양한 문자열의 구성을 검사할 수 있는 문자열 구성 판별 함수에 대해서 알아보자.

 

문자열 구성 판별 함수


728x90

가장 먼저 숫자를 판별할 수 있는 함수들에 대해서 알아보자.

숫자 판별은 3가지 함수가 있는데, 각 함수의 차이점을 비교하여 상황에 따라 적절히 활용하자.

 

문자열 숫자 판별 함수

1. isdecimal()

isdecimal() 함수는 순수 10진수 정수소수점으로 구성된 문자열을 판별할 수 있는 함수이다.

즉 'int'형으로 바로 형 변환할 수 있는 문자열에 대해 True를 반환한다.

 

>>> "12345".isdecimal()
True
>>> "123.45".isdecimal()
False
>>> "1234⁵".isdecimal()
False
>>> "123⅘".isdecimal()
False

 

2. isdigit()

isdigit() 함수는 정수지수로 구성된 문자열을 판별할 수 있는 함수이다.

단, isdigit() 함수에서는 isdecimal() 함수와는 다르게 소수점이 포함되면 False를 반환한다.

 

>>> "12345".isdigit()
True
>>> "123.45".isdigit()
False
>>> "1234⁵".isdigit()
True
>>> "123⅘".isdigit()
False

 

3. isnumeric()

isnumeric() 함수는 정수, 지수, 분수로 구성된 문자열을 판별할 수 있으며, 수를 나타내는 대부분의 특수문자(Ⅳ, ㆕, ...)에 대해서도 True를 반환한다.

단, isdigit() 함수와 동일하게 소수점이 포함되면 False를 반환한다.

 

>>> "12345".isnumeric()
True
>>> "123.45".isnumeric()
False
>>> "1234⁵".isnumeric()
True
>>> "123⅘".isnumeric()
True

세 가지 문자열 숫자 판별 함수 모두 음수(-)는 지원하지 않는데, 필요하다면 아래와 같이 응용할 수 있다.

>>> "-12345".lstrip("-").isdigit()
True

해당 코드는 문자열 "-12345"에서 '-'를 제거한 나머지를 isdisit()로 검증한다.

 

또한 각 함수별 허용 문자 범위는 대략적으로 표현하면 다음과 같다.

 

isnumeric() > isdigit() > isdecimal()

 

그러나, 세 가지 함수 모두 필요 이상의 특수문자에 대해 True를 반환하고 있어 사용 시 각별한 주의가 필요하다.

만약 좀 더 디테일한 문자열 구성 유효성 검증이 필요할 경우 정규표현식을 사용하도록 하자.

 

세 가지 함수가 허용하는 모든 문자를 확인하려면 아래의 코드를 실행하고 결과를 살펴보자.

i = 0

while i < 65536:
    try:
        a = chr(i).isnumeric()
        b = chr(i).isdigit()
        c = chr(i).isdecimal()
        if a or b or c:
            l = []
            if a: l.append("isnumeric")
            if b: l.append("isdigit")
            if c: l.append("isdecimal")
            print("{0}: {1} ({2})".format(i, ", ".join(l), repr(chr(i))))
    
    except:
        print("{0} (unsupported numeric character)".format(i))
    
    i += 1

(실행 결과)

더보기
48: isnumeric, isdigit, isdecimal ('0')
49: isnumeric, isdigit, isdecimal ('1')
50: isnumeric, isdigit, isdecimal ('2')
51: isnumeric, isdigit, isdecimal ('3')
52: isnumeric, isdigit, isdecimal ('4')
53: isnumeric, isdigit, isdecimal ('5')
54: isnumeric, isdigit, isdecimal ('6')
55: isnumeric, isdigit, isdecimal ('7')
56: isnumeric, isdigit, isdecimal ('8')
57: isnumeric, isdigit, isdecimal ('9')
178: isnumeric, isdigit ('²')
179: isnumeric, isdigit ('³')
185: isnumeric, isdigit ('¹')
188: isnumeric ('¼')
189: isnumeric ('½')
190: isnumeric ('¾')
1632: isnumeric, isdigit, isdecimal ('٠')
1633: isnumeric, isdigit, isdecimal ('١')
1634: isnumeric, isdigit, isdecimal ('٢')
1635: isnumeric, isdigit, isdecimal ('٣')
1636: isnumeric, isdigit, isdecimal ('٤')
1637: isnumeric, isdigit, isdecimal ('٥')
1638: isnumeric, isdigit, isdecimal ('٦')
1639: isnumeric, isdigit, isdecimal ('٧')
1640: isnumeric, isdigit, isdecimal ('٨')
1641: isnumeric, isdigit, isdecimal ('٩')
1776: isnumeric, isdigit, isdecimal ('۰')
1777: isnumeric, isdigit, isdecimal ('۱')
1778: isnumeric, isdigit, isdecimal ('۲')
1779: isnumeric, isdigit, isdecimal ('۳')
1780: isnumeric, isdigit, isdecimal ('۴')
1781: isnumeric, isdigit, isdecimal ('۵')
1782: isnumeric, isdigit, isdecimal ('۶')
1783: isnumeric, isdigit, isdecimal ('۷')
1784: isnumeric, isdigit, isdecimal ('۸')
1785: isnumeric, isdigit, isdecimal ('۹')
1984: isnumeric, isdigit, isdecimal ('߀')
1985: isnumeric, isdigit, isdecimal ('߁')
1986: isnumeric, isdigit, isdecimal ('߂')
1987: isnumeric, isdigit, isdecimal ('߃')
1988: isnumeric, isdigit, isdecimal ('߄')
1989: isnumeric, isdigit, isdecimal ('߅')
1990: isnumeric, isdigit, isdecimal ('߆')
1991: isnumeric, isdigit, isdecimal ('߇')
1992: isnumeric, isdigit, isdecimal ('߈')
1993: isnumeric, isdigit, isdecimal ('߉')
2406: isnumeric, isdigit, isdecimal ('०')
2407: isnumeric, isdigit, isdecimal ('१')
2408: isnumeric, isdigit, isdecimal ('२')
2409: isnumeric, isdigit, isdecimal ('३')
2410: isnumeric, isdigit, isdecimal ('४')
2411: isnumeric, isdigit, isdecimal ('५')
2412: isnumeric, isdigit, isdecimal ('६')
2413: isnumeric, isdigit, isdecimal ('७')
2414: isnumeric, isdigit, isdecimal ('८')
2415: isnumeric, isdigit, isdecimal ('९')
2534: isnumeric, isdigit, isdecimal ('০')
2535: isnumeric, isdigit, isdecimal ('১')
2536: isnumeric, isdigit, isdecimal ('২')
2537: isnumeric, isdigit, isdecimal ('৩')
2538: isnumeric, isdigit, isdecimal ('৪')
2539: isnumeric, isdigit, isdecimal ('৫')
2540: isnumeric, isdigit, isdecimal ('৬')
2541: isnumeric, isdigit, isdecimal ('৭')
2542: isnumeric, isdigit, isdecimal ('৮')
2543: isnumeric, isdigit, isdecimal ('৯')
2548: isnumeric ('৴')
2549: isnumeric ('৵')
2550: isnumeric ('৶')
2551: isnumeric ('৷')
2552: isnumeric ('৸')
2553: isnumeric ('৹')
2662: isnumeric, isdigit, isdecimal ('੦')
2663: isnumeric, isdigit, isdecimal ('੧')
2664: isnumeric, isdigit, isdecimal ('੨')
2665: isnumeric, isdigit, isdecimal ('੩')
2666: isnumeric, isdigit, isdecimal ('੪')
2667: isnumeric, isdigit, isdecimal ('੫')
2668: isnumeric, isdigit, isdecimal ('੬')
2669: isnumeric, isdigit, isdecimal ('੭')
2670: isnumeric, isdigit, isdecimal ('੮')
2671: isnumeric, isdigit, isdecimal ('੯')
2790: isnumeric, isdigit, isdecimal ('૦')
2791: isnumeric, isdigit, isdecimal ('૧')
2792: isnumeric, isdigit, isdecimal ('૨')
2793: isnumeric, isdigit, isdecimal ('૩')
2794: isnumeric, isdigit, isdecimal ('૪')
2795: isnumeric, isdigit, isdecimal ('૫')
2796: isnumeric, isdigit, isdecimal ('૬')
2797: isnumeric, isdigit, isdecimal ('૭')
2798: isnumeric, isdigit, isdecimal ('૮')
2799: isnumeric, isdigit, isdecimal ('૯')
2918: isnumeric, isdigit, isdecimal ('୦')
2919: isnumeric, isdigit, isdecimal ('୧')
2920: isnumeric, isdigit, isdecimal ('୨')
2921: isnumeric, isdigit, isdecimal ('୩')
2922: isnumeric, isdigit, isdecimal ('୪')
2923: isnumeric, isdigit, isdecimal ('୫')
2924: isnumeric, isdigit, isdecimal ('୬')
2925: isnumeric, isdigit, isdecimal ('୭')
2926: isnumeric, isdigit, isdecimal ('୮')
2927: isnumeric, isdigit, isdecimal ('୯')
2930: isnumeric ('୲')
2931: isnumeric ('୳')
2932: isnumeric ('୴')
2933: isnumeric ('୵')
2934: isnumeric ('୶')
2935: isnumeric ('୷')
3046: isnumeric, isdigit, isdecimal ('௦')
3047: isnumeric, isdigit, isdecimal ('௧')
3048: isnumeric, isdigit, isdecimal ('௨')
3049: isnumeric, isdigit, isdecimal ('௩')
3050: isnumeric, isdigit, isdecimal ('௪')
3051: isnumeric, isdigit, isdecimal ('௫')
3052: isnumeric, isdigit, isdecimal ('௬')
3053: isnumeric, isdigit, isdecimal ('௭')
3054: isnumeric, isdigit, isdecimal ('௮')
3055: isnumeric, isdigit, isdecimal ('௯')
3056: isnumeric ('௰')
3057: isnumeric ('௱')
3058: isnumeric ('௲')
3174: isnumeric, isdigit, isdecimal ('౦')
3175: isnumeric, isdigit, isdecimal ('౧')
3176: isnumeric, isdigit, isdecimal ('౨')
3177: isnumeric, isdigit, isdecimal ('౩')
3178: isnumeric, isdigit, isdecimal ('౪')
3179: isnumeric, isdigit, isdecimal ('౫')
3180: isnumeric, isdigit, isdecimal ('౬')
3181: isnumeric, isdigit, isdecimal ('౭')
3182: isnumeric, isdigit, isdecimal ('౮')
3183: isnumeric, isdigit, isdecimal ('౯')
3192: isnumeric ('౸')
3193: isnumeric ('౹')
3194: isnumeric ('౺')
3195: isnumeric ('౻')
3196: isnumeric ('౼')
3197: isnumeric ('౽')
3198: isnumeric ('౾')
3302: isnumeric, isdigit, isdecimal ('೦')
3303: isnumeric, isdigit, isdecimal ('೧')
3304: isnumeric, isdigit, isdecimal ('೨')
3305: isnumeric, isdigit, isdecimal ('೩')
3306: isnumeric, isdigit, isdecimal ('೪')
3307: isnumeric, isdigit, isdecimal ('೫')
3308: isnumeric, isdigit, isdecimal ('೬')
3309: isnumeric, isdigit, isdecimal ('೭')
3310: isnumeric, isdigit, isdecimal ('೮')
3311: isnumeric, isdigit, isdecimal ('೯')
3416: isnumeric ('൘')
3417: isnumeric ('൙')
3418: isnumeric ('൚')
3419: isnumeric ('൛')
3420: isnumeric ('൜')
3421: isnumeric ('൝')
3422: isnumeric ('൞')
3430: isnumeric, isdigit, isdecimal ('൦')
3431: isnumeric, isdigit, isdecimal ('൧')
3432: isnumeric, isdigit, isdecimal ('൨')
3433: isnumeric, isdigit, isdecimal ('൩')
3434: isnumeric, isdigit, isdecimal ('൪')
3435: isnumeric, isdigit, isdecimal ('൫')
3436: isnumeric, isdigit, isdecimal ('൬')
3437: isnumeric, isdigit, isdecimal ('൭')
3438: isnumeric, isdigit, isdecimal ('൮')
3439: isnumeric, isdigit, isdecimal ('൯')
3440: isnumeric ('൰')
3441: isnumeric ('൱')
3442: isnumeric ('൲')
3443: isnumeric ('൳')
3444: isnumeric ('൴')
3445: isnumeric ('൵')
3446: isnumeric ('൶')
3447: isnumeric ('൷')
3448: isnumeric ('൸')
3558: isnumeric, isdigit, isdecimal ('෦')
3559: isnumeric, isdigit, isdecimal ('෧')
3560: isnumeric, isdigit, isdecimal ('෨')
3561: isnumeric, isdigit, isdecimal ('෩')
3562: isnumeric, isdigit, isdecimal ('෪')
3563: isnumeric, isdigit, isdecimal ('෫')
3564: isnumeric, isdigit, isdecimal ('෬')
3565: isnumeric, isdigit, isdecimal ('෭')
3566: isnumeric, isdigit, isdecimal ('෮')
3567: isnumeric, isdigit, isdecimal ('෯')
3664: isnumeric, isdigit, isdecimal ('๐')
3665: isnumeric, isdigit, isdecimal ('๑')
3666: isnumeric, isdigit, isdecimal ('๒')
3667: isnumeric, isdigit, isdecimal ('๓')
3668: isnumeric, isdigit, isdecimal ('๔')
3669: isnumeric, isdigit, isdecimal ('๕')
3670: isnumeric, isdigit, isdecimal ('๖')
3671: isnumeric, isdigit, isdecimal ('๗')
3672: isnumeric, isdigit, isdecimal ('๘')
3673: isnumeric, isdigit, isdecimal ('๙')
3792: isnumeric, isdigit, isdecimal ('໐')
3793: isnumeric, isdigit, isdecimal ('໑')
3794: isnumeric, isdigit, isdecimal ('໒')
3795: isnumeric, isdigit, isdecimal ('໓')
3796: isnumeric, isdigit, isdecimal ('໔')
3797: isnumeric, isdigit, isdecimal ('໕')
3798: isnumeric, isdigit, isdecimal ('໖')
3799: isnumeric, isdigit, isdecimal ('໗')
3800: isnumeric, isdigit, isdecimal ('໘')
3801: isnumeric, isdigit, isdecimal ('໙')
3872: isnumeric, isdigit, isdecimal ('༠')
3873: isnumeric, isdigit, isdecimal ('༡')
3874: isnumeric, isdigit, isdecimal ('༢')
3875: isnumeric, isdigit, isdecimal ('༣')
3876: isnumeric, isdigit, isdecimal ('༤')
3877: isnumeric, isdigit, isdecimal ('༥')
3878: isnumeric, isdigit, isdecimal ('༦')
3879: isnumeric, isdigit, isdecimal ('༧')
3880: isnumeric, isdigit, isdecimal ('༨')
3881: isnumeric, isdigit, isdecimal ('༩')
3882: isnumeric ('༪')
3883: isnumeric ('༫')
3884: isnumeric ('༬')
3885: isnumeric ('༭')
3886: isnumeric ('༮')
3887: isnumeric ('༯')
3888: isnumeric ('༰')
3889: isnumeric ('༱')
3890: isnumeric ('༲')
3891: isnumeric ('༳')
4160: isnumeric, isdigit, isdecimal ('၀')
4161: isnumeric, isdigit, isdecimal ('၁')
4162: isnumeric, isdigit, isdecimal ('၂')
4163: isnumeric, isdigit, isdecimal ('၃')
4164: isnumeric, isdigit, isdecimal ('၄')
4165: isnumeric, isdigit, isdecimal ('၅')
4166: isnumeric, isdigit, isdecimal ('၆')
4167: isnumeric, isdigit, isdecimal ('၇')
4168: isnumeric, isdigit, isdecimal ('၈')
4169: isnumeric, isdigit, isdecimal ('၉')
4240: isnumeric, isdigit, isdecimal ('႐')
4241: isnumeric, isdigit, isdecimal ('႑')
4242: isnumeric, isdigit, isdecimal ('႒')
4243: isnumeric, isdigit, isdecimal ('႓')
4244: isnumeric, isdigit, isdecimal ('႔')
4245: isnumeric, isdigit, isdecimal ('႕')
4246: isnumeric, isdigit, isdecimal ('႖')
4247: isnumeric, isdigit, isdecimal ('႗')
4248: isnumeric, isdigit, isdecimal ('႘')
4249: isnumeric, isdigit, isdecimal ('႙')
4969: isnumeric, isdigit ('፩')
4970: isnumeric, isdigit ('፪')
4971: isnumeric, isdigit ('፫')
4972: isnumeric, isdigit ('፬')
4973: isnumeric, isdigit ('፭')
4974: isnumeric, isdigit ('፮')
4975: isnumeric, isdigit ('፯')
4976: isnumeric, isdigit ('፰')
4977: isnumeric, isdigit ('፱')
4978: isnumeric ('፲')
4979: isnumeric ('፳')
4980: isnumeric ('፴')
4981: isnumeric ('፵')
4982: isnumeric ('፶')
4983: isnumeric ('፷')
4984: isnumeric ('፸')
4985: isnumeric ('፹')
4986: isnumeric ('፺')
4987: isnumeric ('፻')
4988: isnumeric ('፼')
5870: isnumeric ('ᛮ')
5871: isnumeric ('ᛯ')
5872: isnumeric ('ᛰ')
6112: isnumeric, isdigit, isdecimal ('០')
6113: isnumeric, isdigit, isdecimal ('១')
6114: isnumeric, isdigit, isdecimal ('២')
6115: isnumeric, isdigit, isdecimal ('៣')
6116: isnumeric, isdigit, isdecimal ('៤')
6117: isnumeric, isdigit, isdecimal ('៥')
6118: isnumeric, isdigit, isdecimal ('៦')
6119: isnumeric, isdigit, isdecimal ('៧')
6120: isnumeric, isdigit, isdecimal ('៨')
6121: isnumeric, isdigit, isdecimal ('៩')
6128: isnumeric ('៰')
6129: isnumeric ('៱')
6130: isnumeric ('៲')
6131: isnumeric ('៳')
6132: isnumeric ('៴')
6133: isnumeric ('៵')
6134: isnumeric ('៶')
6135: isnumeric ('៷')
6136: isnumeric ('៸')
6137: isnumeric ('៹')
6160: isnumeric, isdigit, isdecimal ('᠐')
6161: isnumeric, isdigit, isdecimal ('᠑')
6162: isnumeric, isdigit, isdecimal ('᠒')
6163: isnumeric, isdigit, isdecimal ('᠓')
6164: isnumeric, isdigit, isdecimal ('᠔')
6165: isnumeric, isdigit, isdecimal ('᠕')
6166: isnumeric, isdigit, isdecimal ('᠖')
6167: isnumeric, isdigit, isdecimal ('᠗')
6168: isnumeric, isdigit, isdecimal ('᠘')
6169: isnumeric, isdigit, isdecimal ('᠙')
6470: isnumeric, isdigit, isdecimal ('᥆')
6471: isnumeric, isdigit, isdecimal ('᥇')
6472: isnumeric, isdigit, isdecimal ('᥈')
6473: isnumeric, isdigit, isdecimal ('᥉')
6474: isnumeric, isdigit, isdecimal ('᥊')
6475: isnumeric, isdigit, isdecimal ('᥋')
6476: isnumeric, isdigit, isdecimal ('᥌')
6477: isnumeric, isdigit, isdecimal ('᥍')
6478: isnumeric, isdigit, isdecimal ('᥎')
6479: isnumeric, isdigit, isdecimal ('᥏')
6608: isnumeric, isdigit, isdecimal ('᧐')
6609: isnumeric, isdigit, isdecimal ('᧑')
6610: isnumeric, isdigit, isdecimal ('᧒')
6611: isnumeric, isdigit, isdecimal ('᧓')
6612: isnumeric, isdigit, isdecimal ('᧔')
6613: isnumeric, isdigit, isdecimal ('᧕')
6614: isnumeric, isdigit, isdecimal ('᧖')
6615: isnumeric, isdigit, isdecimal ('᧗')
6616: isnumeric, isdigit, isdecimal ('᧘')
6617: isnumeric, isdigit, isdecimal ('᧙')
6618: isnumeric, isdigit ('᧚')
6784: isnumeric, isdigit, isdecimal ('᪀')
6785: isnumeric, isdigit, isdecimal ('᪁')
6786: isnumeric, isdigit, isdecimal ('᪂')
6787: isnumeric, isdigit, isdecimal ('᪃')
6788: isnumeric, isdigit, isdecimal ('᪄')
6789: isnumeric, isdigit, isdecimal ('᪅')
6790: isnumeric, isdigit, isdecimal ('᪆')
6791: isnumeric, isdigit, isdecimal ('᪇')
6792: isnumeric, isdigit, isdecimal ('᪈')
6793: isnumeric, isdigit, isdecimal ('᪉')
6800: isnumeric, isdigit, isdecimal ('᪐')
6801: isnumeric, isdigit, isdecimal ('᪑')
6802: isnumeric, isdigit, isdecimal ('᪒')
6803: isnumeric, isdigit, isdecimal ('᪓')
6804: isnumeric, isdigit, isdecimal ('᪔')
6805: isnumeric, isdigit, isdecimal ('᪕')
6806: isnumeric, isdigit, isdecimal ('᪖')
6807: isnumeric, isdigit, isdecimal ('᪗')
6808: isnumeric, isdigit, isdecimal ('᪘')
6809: isnumeric, isdigit, isdecimal ('᪙')
6992: isnumeric, isdigit, isdecimal ('᭐')
6993: isnumeric, isdigit, isdecimal ('᭑')
6994: isnumeric, isdigit, isdecimal ('᭒')
6995: isnumeric, isdigit, isdecimal ('᭓')
6996: isnumeric, isdigit, isdecimal ('᭔')
6997: isnumeric, isdigit, isdecimal ('᭕')
6998: isnumeric, isdigit, isdecimal ('᭖')
6999: isnumeric, isdigit, isdecimal ('᭗')
7000: isnumeric, isdigit, isdecimal ('᭘')
7001: isnumeric, isdigit, isdecimal ('᭙')
7088: isnumeric, isdigit, isdecimal ('᮰')
7089: isnumeric, isdigit, isdecimal ('᮱')
7090: isnumeric, isdigit, isdecimal ('᮲')
7091: isnumeric, isdigit, isdecimal ('᮳')
7092: isnumeric, isdigit, isdecimal ('᮴')
7093: isnumeric, isdigit, isdecimal ('᮵')
7094: isnumeric, isdigit, isdecimal ('᮶')
7095: isnumeric, isdigit, isdecimal ('᮷')
7096: isnumeric, isdigit, isdecimal ('᮸')
7097: isnumeric, isdigit, isdecimal ('᮹')
7232: isnumeric, isdigit, isdecimal ('᱀')
7233: isnumeric, isdigit, isdecimal ('᱁')
7234: isnumeric, isdigit, isdecimal ('᱂')
7235: isnumeric, isdigit, isdecimal ('᱃')
7236: isnumeric, isdigit, isdecimal ('᱄')
7237: isnumeric, isdigit, isdecimal ('᱅')
7238: isnumeric, isdigit, isdecimal ('᱆')
7239: isnumeric, isdigit, isdecimal ('᱇')
7240: isnumeric, isdigit, isdecimal ('᱈')
7241: isnumeric, isdigit, isdecimal ('᱉')
7248: isnumeric, isdigit, isdecimal ('᱐')
7249: isnumeric, isdigit, isdecimal ('᱑')
7250: isnumeric, isdigit, isdecimal ('᱒')
7251: isnumeric, isdigit, isdecimal ('᱓')
7252: isnumeric, isdigit, isdecimal ('᱔')
7253: isnumeric, isdigit, isdecimal ('᱕')
7254: isnumeric, isdigit, isdecimal ('᱖')
7255: isnumeric, isdigit, isdecimal ('᱗')
7256: isnumeric, isdigit, isdecimal ('᱘')
7257: isnumeric, isdigit, isdecimal ('᱙')
8304: isnumeric, isdigit ('⁰')
8308: isnumeric, isdigit ('⁴')
8309: isnumeric, isdigit ('⁵')
8310: isnumeric, isdigit ('⁶')
8311: isnumeric, isdigit ('⁷')
8312: isnumeric, isdigit ('⁸')
8313: isnumeric, isdigit ('⁹')
8320: isnumeric, isdigit ('₀')
8321: isnumeric, isdigit ('₁')
8322: isnumeric, isdigit ('₂')
8323: isnumeric, isdigit ('₃')
8324: isnumeric, isdigit ('₄')
8325: isnumeric, isdigit ('₅')
8326: isnumeric, isdigit ('₆')
8327: isnumeric, isdigit ('₇')
8328: isnumeric, isdigit ('₈')
8329: isnumeric, isdigit ('₉')
8528: isnumeric ('⅐')
8529: isnumeric ('⅑')
8530: isnumeric ('⅒')
8531: isnumeric ('⅓')
8532: isnumeric ('⅔')
8533: isnumeric ('⅕')
8534: isnumeric ('⅖')
8535: isnumeric ('⅗')
8536: isnumeric ('⅘')
8537: isnumeric ('⅙')
8538: isnumeric ('⅚')
8539: isnumeric ('⅛')
8540: isnumeric ('⅜')
8541: isnumeric ('⅝')
8542: isnumeric ('⅞')
8543: isnumeric ('⅟')
8544: isnumeric ('Ⅰ')
8545: isnumeric ('Ⅱ')
8546: isnumeric ('Ⅲ')
8547: isnumeric ('Ⅳ')
8548: isnumeric ('Ⅴ')
8549: isnumeric ('Ⅵ')
8550: isnumeric ('Ⅶ')
8551: isnumeric ('Ⅷ')
8552: isnumeric ('Ⅸ')
8553: isnumeric ('Ⅹ')
8554: isnumeric ('Ⅺ')
8555: isnumeric ('Ⅻ')
8556: isnumeric ('Ⅼ')
8557: isnumeric ('Ⅽ')
8558: isnumeric ('Ⅾ')
8559: isnumeric ('Ⅿ')
8560: isnumeric ('ⅰ')
8561: isnumeric ('ⅱ')
8562: isnumeric ('ⅲ')
8563: isnumeric ('ⅳ')
8564: isnumeric ('ⅴ')
8565: isnumeric ('ⅵ')
8566: isnumeric ('ⅶ')
8567: isnumeric ('ⅷ')
8568: isnumeric ('ⅸ')
8569: isnumeric ('ⅹ')
8570: isnumeric ('ⅺ')
8571: isnumeric ('ⅻ')
8572: isnumeric ('ⅼ')
8573: isnumeric ('ⅽ')
8574: isnumeric ('ⅾ')
8575: isnumeric ('ⅿ')
8576: isnumeric ('ↀ')
8577: isnumeric ('ↁ')
8578: isnumeric ('ↂ')
8581: isnumeric ('ↅ')
8582: isnumeric ('ↆ')
8583: isnumeric ('ↇ')
8584: isnumeric ('ↈ')
8585: isnumeric ('↉')
9312: isnumeric, isdigit ('①')
9313: isnumeric, isdigit ('②')
9314: isnumeric, isdigit ('③')
9315: isnumeric, isdigit ('④')
9316: isnumeric, isdigit ('⑤')
9317: isnumeric, isdigit ('⑥')
9318: isnumeric, isdigit ('⑦')
9319: isnumeric, isdigit ('⑧')
9320: isnumeric, isdigit ('⑨')
9321: isnumeric ('⑩')
9322: isnumeric ('⑪')
9323: isnumeric ('⑫')
9324: isnumeric ('⑬')
9325: isnumeric ('⑭')
9326: isnumeric ('⑮')
9327: isnumeric ('⑯')
9328: isnumeric ('⑰')
9329: isnumeric ('⑱')
9330: isnumeric ('⑲')
9331: isnumeric ('⑳')
9332: isnumeric, isdigit ('⑴')
9333: isnumeric, isdigit ('⑵')
9334: isnumeric, isdigit ('⑶')
9335: isnumeric, isdigit ('⑷')
9336: isnumeric, isdigit ('⑸')
9337: isnumeric, isdigit ('⑹')
9338: isnumeric, isdigit ('⑺')
9339: isnumeric, isdigit ('⑻')
9340: isnumeric, isdigit ('⑼')
9341: isnumeric ('⑽')
9342: isnumeric ('⑾')
9343: isnumeric ('⑿')
9344: isnumeric ('⒀')
9345: isnumeric ('⒁')
9346: isnumeric ('⒂')
9347: isnumeric ('⒃')
9348: isnumeric ('⒄')
9349: isnumeric ('⒅')
9350: isnumeric ('⒆')
9351: isnumeric ('⒇')
9352: isnumeric, isdigit ('⒈')
9353: isnumeric, isdigit ('⒉')
9354: isnumeric, isdigit ('⒊')
9355: isnumeric, isdigit ('⒋')
9356: isnumeric, isdigit ('⒌')
9357: isnumeric, isdigit ('⒍')
9358: isnumeric, isdigit ('⒎')
9359: isnumeric, isdigit ('⒏')
9360: isnumeric, isdigit ('⒐')
9361: isnumeric ('⒑')
9362: isnumeric ('⒒')
9363: isnumeric ('⒓')
9364: isnumeric ('⒔')
9365: isnumeric ('⒕')
9366: isnumeric ('⒖')
9367: isnumeric ('⒗')
9368: isnumeric ('⒘')
9369: isnumeric ('⒙')
9370: isnumeric ('⒚')
9371: isnumeric ('⒛')
9450: isnumeric, isdigit ('⓪')
9451: isnumeric ('⓫')
9452: isnumeric ('⓬')
9453: isnumeric ('⓭')
9454: isnumeric ('⓮')
9455: isnumeric ('⓯')
9456: isnumeric ('⓰')
9457: isnumeric ('⓱')
9458: isnumeric ('⓲')
9459: isnumeric ('⓳')
9460: isnumeric ('⓴')
9461: isnumeric, isdigit ('⓵')
9462: isnumeric, isdigit ('⓶')
9463: isnumeric, isdigit ('⓷')
9464: isnumeric, isdigit ('⓸')
9465: isnumeric, isdigit ('⓹')
9466: isnumeric, isdigit ('⓺')
9467: isnumeric, isdigit ('⓻')
9468: isnumeric, isdigit ('⓼')
9469: isnumeric, isdigit ('⓽')
9470: isnumeric ('⓾')
9471: isnumeric, isdigit ('⓿')
10102: isnumeric, isdigit ('❶')
10103: isnumeric, isdigit ('❷')
10104: isnumeric, isdigit ('❸')
10105: isnumeric, isdigit ('❹')
10106: isnumeric, isdigit ('❺')
10107: isnumeric, isdigit ('❻')
10108: isnumeric, isdigit ('❼')
10109: isnumeric, isdigit ('❽')
10110: isnumeric, isdigit ('❾')
10111: isnumeric ('❿')
10112: isnumeric, isdigit ('➀')
10113: isnumeric, isdigit ('➁')
10114: isnumeric, isdigit ('➂')
10115: isnumeric, isdigit ('➃')
10116: isnumeric, isdigit ('➄')
10117: isnumeric, isdigit ('➅')
10118: isnumeric, isdigit ('➆')
10119: isnumeric, isdigit ('➇')
10120: isnumeric, isdigit ('➈')
10121: isnumeric ('➉')
10122: isnumeric, isdigit ('➊')
10123: isnumeric, isdigit ('➋')
10124: isnumeric, isdigit ('➌')
10125: isnumeric, isdigit ('➍')
10126: isnumeric, isdigit ('➎')
10127: isnumeric, isdigit ('➏')
10128: isnumeric, isdigit ('➐')
10129: isnumeric, isdigit ('➑')
10130: isnumeric, isdigit ('➒')
10131: isnumeric ('➓')
11517: isnumeric ('⳽')
12295: isnumeric ('〇')
12321: isnumeric ('〡')
12322: isnumeric ('〢')
12323: isnumeric ('〣')
12324: isnumeric ('〤')
12325: isnumeric ('〥')
12326: isnumeric ('〦')
12327: isnumeric ('〧')
12328: isnumeric ('〨')
12329: isnumeric ('〩')
12344: isnumeric ('〸')
12345: isnumeric ('〹')
12346: isnumeric ('〺')
12690: isnumeric ('㆒')
12691: isnumeric ('㆓')
12692: isnumeric ('㆔')
12693: isnumeric ('㆕')
12832: isnumeric ('㈠')
12833: isnumeric ('㈡')
12834: isnumeric ('㈢')
12835: isnumeric ('㈣')
12836: isnumeric ('㈤')
12837: isnumeric ('㈥')
12838: isnumeric ('㈦')
12839: isnumeric ('㈧')
12840: isnumeric ('㈨')
12841: isnumeric ('㈩')
12872: isnumeric ('㉈')
12873: isnumeric ('㉉')
12874: isnumeric ('㉊')
12875: isnumeric ('㉋')
12876: isnumeric ('㉌')
12877: isnumeric ('㉍')
12878: isnumeric ('㉎')
12879: isnumeric ('㉏')
12881: isnumeric ('㉑')
12882: isnumeric ('㉒')
12883: isnumeric ('㉓')
12884: isnumeric ('㉔')
12885: isnumeric ('㉕')
12886: isnumeric ('㉖')
12887: isnumeric ('㉗')
12888: isnumeric ('㉘')
12889: isnumeric ('㉙')
12890: isnumeric ('㉚')
12891: isnumeric ('㉛')
12892: isnumeric ('㉜')
12893: isnumeric ('㉝')
12894: isnumeric ('㉞')
12895: isnumeric ('㉟')
12928: isnumeric ('㊀')
12929: isnumeric ('㊁')
12930: isnumeric ('㊂')
12931: isnumeric ('㊃')
12932: isnumeric ('㊄')
12933: isnumeric ('㊅')
12934: isnumeric ('㊆')
12935: isnumeric ('㊇')
12936: isnumeric ('㊈')
12937: isnumeric ('㊉')
12977: isnumeric ('㊱')
12978: isnumeric ('㊲')
12979: isnumeric ('㊳')
12980: isnumeric ('㊴')
12981: isnumeric ('㊵')
12982: isnumeric ('㊶')
12983: isnumeric ('㊷')
12984: isnumeric ('㊸')
12985: isnumeric ('㊹')
12986: isnumeric ('㊺')
12987: isnumeric ('㊻')
12988: isnumeric ('㊼')
12989: isnumeric ('㊽')
12990: isnumeric ('㊾')
12991: isnumeric ('㊿')
13317: isnumeric ('㐅')
13443: isnumeric ('㒃')
14378: isnumeric ('㠪')
15181: isnumeric ('㭍')
19968: isnumeric ('一')
19971: isnumeric ('七')
19975: isnumeric ('万')
19977: isnumeric ('三')
20061: isnumeric ('九')
20108: isnumeric ('二')
20116: isnumeric ('五')
20118: isnumeric ('亖')
20159: isnumeric ('亿')
20160: isnumeric ('什')
20191: isnumeric ('仟')
20200: isnumeric ('仨')
20237: isnumeric ('伍')
20336: isnumeric ('佰')
20740: isnumeric ('億')
20806: isnumeric ('兆')
20841: isnumeric ('兩')
20843: isnumeric ('八')
20845: isnumeric ('六')
21313: isnumeric ('十')
21315: isnumeric ('千')
21316: isnumeric ('卄')
21317: isnumeric ('卅')
21324: isnumeric ('卌')
21441: isnumeric ('叁')
21442: isnumeric ('参')
21443: isnumeric ('參')
21444: isnumeric ('叄')
22235: isnumeric ('四')
22769: isnumeric ('壱')
22777: isnumeric ('壹')
24186: isnumeric ('幺')
24318: isnumeric ('廾')
24319: isnumeric ('廿')
24332: isnumeric ('弌')
24333: isnumeric ('弍')
24334: isnumeric ('弎')
24336: isnumeric ('弐')
25342: isnumeric ('拾')
25420: isnumeric ('捌')
26578: isnumeric ('柒')
28422: isnumeric ('漆')
29590: isnumeric ('玖')
30334: isnumeric ('百')
32902: isnumeric ('肆')
33836: isnumeric ('萬')
36014: isnumeric ('貮')
36019: isnumeric ('貳')
36144: isnumeric ('贰')
38433: isnumeric ('阡')
38470: isnumeric ('陆')
38476: isnumeric ('陌')
38520: isnumeric ('陸')
38646: isnumeric ('零')
42528: isnumeric, isdigit, isdecimal ('꘠')
42529: isnumeric, isdigit, isdecimal ('꘡')
42530: isnumeric, isdigit, isdecimal ('꘢')
42531: isnumeric, isdigit, isdecimal ('꘣')
42532: isnumeric, isdigit, isdecimal ('꘤')
42533: isnumeric, isdigit, isdecimal ('꘥')
42534: isnumeric, isdigit, isdecimal ('꘦')
42535: isnumeric, isdigit, isdecimal ('꘧')
42536: isnumeric, isdigit, isdecimal ('꘨')
42537: isnumeric, isdigit, isdecimal ('꘩')
42726: isnumeric ('ꛦ')
42727: isnumeric ('ꛧ')
42728: isnumeric ('ꛨ')
42729: isnumeric ('ꛩ')
42730: isnumeric ('ꛪ')
42731: isnumeric ('ꛫ')
42732: isnumeric ('ꛬ')
42733: isnumeric ('ꛭ')
42734: isnumeric ('ꛮ')
42735: isnumeric ('ꛯ')
43056: isnumeric ('꠰')
43057: isnumeric ('꠱')
43058: isnumeric ('꠲')
43059: isnumeric ('꠳')
43060: isnumeric ('꠴')
43061: isnumeric ('꠵')
43216: isnumeric, isdigit, isdecimal ('꣐')
43217: isnumeric, isdigit, isdecimal ('꣑')
43218: isnumeric, isdigit, isdecimal ('꣒')
43219: isnumeric, isdigit, isdecimal ('꣓')
43220: isnumeric, isdigit, isdecimal ('꣔')
43221: isnumeric, isdigit, isdecimal ('꣕')
43222: isnumeric, isdigit, isdecimal ('꣖')
43223: isnumeric, isdigit, isdecimal ('꣗')
43224: isnumeric, isdigit, isdecimal ('꣘')
43225: isnumeric, isdigit, isdecimal ('꣙')
43264: isnumeric, isdigit, isdecimal ('꤀')
43265: isnumeric, isdigit, isdecimal ('꤁')
43266: isnumeric, isdigit, isdecimal ('꤂')
43267: isnumeric, isdigit, isdecimal ('꤃')
43268: isnumeric, isdigit, isdecimal ('꤄')
43269: isnumeric, isdigit, isdecimal ('꤅')
43270: isnumeric, isdigit, isdecimal ('꤆')
43271: isnumeric, isdigit, isdecimal ('꤇')
43272: isnumeric, isdigit, isdecimal ('꤈')
43273: isnumeric, isdigit, isdecimal ('꤉')
43472: isnumeric, isdigit, isdecimal ('꧐')
43473: isnumeric, isdigit, isdecimal ('꧑')
43474: isnumeric, isdigit, isdecimal ('꧒')
43475: isnumeric, isdigit, isdecimal ('꧓')
43476: isnumeric, isdigit, isdecimal ('꧔')
43477: isnumeric, isdigit, isdecimal ('꧕')
43478: isnumeric, isdigit, isdecimal ('꧖')
43479: isnumeric, isdigit, isdecimal ('꧗')
43480: isnumeric, isdigit, isdecimal ('꧘')
43481: isnumeric, isdigit, isdecimal ('꧙')
43504: isnumeric, isdigit, isdecimal ('꧰')
43505: isnumeric, isdigit, isdecimal ('꧱')
43506: isnumeric, isdigit, isdecimal ('꧲')
43507: isnumeric, isdigit, isdecimal ('꧳')
43508: isnumeric, isdigit, isdecimal ('꧴')
43509: isnumeric, isdigit, isdecimal ('꧵')
43510: isnumeric, isdigit, isdecimal ('꧶')
43511: isnumeric, isdigit, isdecimal ('꧷')
43512: isnumeric, isdigit, isdecimal ('꧸')
43513: isnumeric, isdigit, isdecimal ('꧹')
43600: isnumeric, isdigit, isdecimal ('꩐')
43601: isnumeric, isdigit, isdecimal ('꩑')
43602: isnumeric, isdigit, isdecimal ('꩒')
43603: isnumeric, isdigit, isdecimal ('꩓')
43604: isnumeric, isdigit, isdecimal ('꩔')
43605: isnumeric, isdigit, isdecimal ('꩕')
43606: isnumeric, isdigit, isdecimal ('꩖')
43607: isnumeric, isdigit, isdecimal ('꩗')
43608: isnumeric, isdigit, isdecimal ('꩘')
43609: isnumeric, isdigit, isdecimal ('꩙')
44016: isnumeric, isdigit, isdecimal ('꯰')
44017: isnumeric, isdigit, isdecimal ('꯱')
44018: isnumeric, isdigit, isdecimal ('꯲')
44019: isnumeric, isdigit, isdecimal ('꯳')
44020: isnumeric, isdigit, isdecimal ('꯴')
44021: isnumeric, isdigit, isdecimal ('꯵')
44022: isnumeric, isdigit, isdecimal ('꯶')
44023: isnumeric, isdigit, isdecimal ('꯷')
44024: isnumeric, isdigit, isdecimal ('꯸')
44025: isnumeric, isdigit, isdecimal ('꯹')
63851: isnumeric ('參')
63859: isnumeric ('拾')
63864: isnumeric ('兩')
63922: isnumeric ('零')
63953: isnumeric ('六')
63955: isnumeric ('陸')
63997: isnumeric ('什')
65296: isnumeric, isdigit, isdecimal ('0')
65297: isnumeric, isdigit, isdecimal ('1')
65298: isnumeric, isdigit, isdecimal ('2')
65299: isnumeric, isdigit, isdecimal ('3')
65300: isnumeric, isdigit, isdecimal ('4')
65301: isnumeric, isdigit, isdecimal ('5')
65302: isnumeric, isdigit, isdecimal ('6')
65303: isnumeric, isdigit, isdecimal ('7')
65304: isnumeric, isdigit, isdecimal ('8')
65305: isnumeric, isdigit, isdecimal ('9')

 


 

다음은 영문이 포함된 문자열을 판별할 수 있는 함수들에 대해서 알아보자.

 

영문이 포함된 문자열 판별 함수

1. isalpha()

isalnum() 함수는 모든 문자열이 알파벳으로 이루어져 있는지 판별하는 함수이다.

대소문자는 구분하지 않으며 공백(' ') 문자에 대해서는 False를 반환한다.

 

>>> "abcdEFGH".isalpha()
True
>>> "abcd1234".isalpha()
False
>>> "IT is Guide".isalpha()
False

 

2. isalnum()

isalnum() 함수는 isalnum() + isnumeric()을 조합한 함수로, 특수기호가 없는 영숫자로 구성된 문자열을 판별할 수 있다.

 

>>> "abcdEFGH".isalnum()
True
>>> "abcd1234".isalnum()
True
>>> "IT is Guide".isalnum()
False

 

 

반응형
반응형

C 런타임 라이브러리


런타임 라이브러리 링크 옵션인 /MD 및 /MT 컴파일 옵션을 이해하기 위해서는 런타임 라이브러리에 대한 이해가 필요하다.

 

런타임 라이브러리(Run-Time Libraries)란 여러 프로그램들이 실행 중에 입력과 출력, 메모리 관리, 연산, 예외 처리 등 공통적으로 필요로 하는 기능들을 별도의 라이브러리 형태로 묶어서 제공하는 것을 의미한다.

 

C/C++에서는 대표적으로 C 런타임 라이브러리(CRT; C Run-Time Libraries)가 있으며, 이는 ISO C99 표준 라이브러리를 통합하는 C++ 표준 라이브러리의 일부이다. 즉 C/C++로 작성된 프로그램이 실행 중에 기본적으로 필요로 하는 기능들을 포함하여 라이브러리 형태로 제공된 것을 의미한다.

728x90

 

/MD vs /MT 컴파일 옵션의 차이점


/MD 및 /MT 컴파일 옵션은 위에서 언급한 C 런타임 라이브러리(CRT)의 연결 방식과 관련된 옵션이다.

MD는 Multi-Threaded DLL, MT는 Multi-Threaded의 약자이며, 두 가지 옵션 모두 다중 스레드 개발을 지원한다는 의미이기도 하다.

참고로 /MDd, /MTd는 /MD 및 /MT의 디버그용 옵션이다.

 

과거에는 싱글 스레드만 지원하는 /ML, /MLd 옵션도 제공이 되었지만 최근의 멀티 코어, 멀티 스레드 환경에서는 경우에 따라 문제가 발생할 소지가 있어 제거된 것으로 보인다.

 

/MD 및 /MT 컴파일 옵션의 특징은 다음과 같이 정리할 수 있다.

/MD (Multi-Threaded DLL)

  • /MD 옵션은 C 런타임 라이브러리를 별도의 DLL로 동적으로 연결(dynamic link)하는 방식
  • MSVCRT.lib가 .obj 파일에 배치되어 빌드된다. (디버그 모드의 경우 MSVCRTD.lib)
  • 여러 실행 파일이 라이브러리를 공유하여 사용할 수 있어 실행 파일 크기 및 메모리 사용량 감소
  • 실행 파일 배포 시 반드시 재배포 패키지를 함께 배포해야 함

 

/MT (Multi-Threaded)

  • /MT 옵션은 C 런타임 라이브러리를 실행 파일 내에 포함하여 정적으로 연결(static link)하는 방식이다.
  • LIBCMT.lib가 .obj 파일에 배치되어 빌드된다. (디버그 모드의 경우 LIBCMTD.lib)
  • 대상 시스템에 설치된 DLL에 의존하지 않는다.
  • 실행 파일의 크기가 커진다.

 

런타임 라이브러리 링크 /MD, /MT 설정 방법

  • [프로젝트 속성] -> [구성 속성] -> [C/C++] -> [코드 생성] : 런타임 라이브러리 선택

 


단일 실행 파일을 배포하는 경우라면 /MT 옵션으로 배포하는 것이 간편하겠지만,
다수개의 실행 파일을 배포하는 경우 /MD 옵션을 사용하면 배포 크기 및 메모리 사용량 측면에서 효율적일 수 있다.

 

만약 /MD 컴파일 옵션 사용 시 재배포 패키지를 함께 배포하지 않으면 다음과 같은 시스템 오류가 발생할 수 있다.

 

"VCRUNTIME140.dll이(가) 없어 코드 실행을 진행할 수 없습니다. 프로그램을 다시 설치하면 이 문제가 해결될 수 있습니다."

 

/MD 컴파일 옵션으로 배포 후 문제가 발생할 경우 아래 링크를 참고하여 재배포 패키지를 설치하면 되겠다.

 

VCRUNTIME140.dll 시스템 오류, 간단하게 해결해보자!

VCRUNTIME140.dll 시스템 오류, 왜 발생하는 걸까? 간혹 프로그램을 실행할 때 아래와 같은 시스템 오류를 만나게된다. "VCRUNTIME140.dll이(가) 없어 코드 실행을 진행할 수 없습니다. 프로그램을 다시 설

itisguide.tistory.com

반응형

+ Recent posts