_pgmptr, _wpgmptr

실행 파일의 경로입니다.사용 되지 않습니다. use _get_pgmptr and _get_wpgmptr.

extern char *_pgmptr;
extern wchar_t *_wpgmptr;

설명

명령 인터프리터 (Cmd.exe)에서 프로그램을 실행할 때 _pgmptr 실행 파일의 전체 경로를 자동으로 초기화 됩니다.Hello.exe c:\bin 디렉터리 및 c:\bin 디렉터리에 있으면 경로에 _pgmptr c:\bin\hello.exe를 실행 하는 경우 설정 됩니다.

C> hello 

명령줄에서 프로그램이 실행 되지 않을 때 _pgmptr 해당 프로그램 이름 (파일 확장명 제외 된 파일의 기본 이름) 또는 파일 이름, 상대 경로 또는 전체 경로를 초기화할 수 있습니다.

_wpgmptr상응 하는 와이드 문자입니다 _pgmptr 와 함께 사용 하 여 프로그램 사용에 대 한 wmain.

일반 텍스트 루틴 매핑

Tchar.h 루틴

_UNICODE 및 _mbcs가 정의 되지 않았습니다.

_Mbcs가 정의

_Unicode가 정의

_tpgmptr

_pgmptr

_pgmptr

_wpgmptr

요구 사항

변수

필수 헤더

_pgmptr, _wpgmptr

<stdlib.h>

예제

다음 프로그램의 사용 방법을 보여 줍니다. _pgmptr.

// crt_pgmptr.c
// compile with: /W3
// The following program demonstrates the use of _pgmptr.
//
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
   printf("The full path of the executing program is : %Fs\n", 
     _pgmptr); // C4996
   // Note: _pgmptr is deprecated; use _get_pgmptr instead
}

You could use _wpgmptr by changing %Fs to %S and main to wmain.

참고 항목

참조

전역 변수