글
리눅스에서 환경정보를 읽어오는 코드 예제.
- showenv.c
#include <stdlib.h>
#include <stdio.h>
extern char **environ; // 외우자
int main()
{
char **env = environ;
while(*env)
{
printf("%s\n", *env);
env++;
}
}
- compile
gcc -o showenv showenv.c
- execution
./showenv
'Biz > Programming' 카테고리의 다른 글
wxWidgets in VS2010 - Hello World (0) | 2013.12.07 |
---|---|
[QT]-[error] close() was not declared in this scope (0) | 2013.12.06 |
How to install qtcreator on Kali 1.0.5 GNOME (0) | 2013.10.15 |
ubuntu 에서 gtk 설치 & sample code (0) | 2013.10.11 |
linux에서 현재시간 얻어오기 실습 (0) | 2013.10.10 |
RECENT COMMENT