일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Rally
- NS-2
- aero glass
- 동호대교
- 무선통신
- gnuplot
- calloc
- malloc
- C++
- Wireless Network
- TCL
- hop
- 동적 메모리 할당
- Programming
- 애드혹
- simple-wireless
- throughput
- 네트워크 시뮬레이터
- Elasticsearch
- adhoc
- ns2
- C
- putty
- awk
- trace file format
- networking
Archives
- Today
- Total
목록Programming (1)
Pururoong
동적 메모리 할당(Dynamic Memory Allocation)
■ C언어에서 변수를 저장하는 방법은 2가지가 있다. ■ 전역, 지역변수, 배열, 구조체는 정적 메모리 할당(Static Memory AlLocation) 이다. ■ 동적 메모리 할당은 프로그램이 얼마만큼의 메모리를 사용할 지 명확하지 않은 경우에 쓰는 방법이다. 이 방법은 여러가지 위험요소를 가져오기 때문에 꼭 필요한 경우에 사용하는 것이 좋다. ■ 이하 사용함수와 포인터를 이용한 동적 메모리 할당 예제. -> 동적 할당 함수사용에 필요한 헤더파일 : stdlib.h 사용함수 : calloc(), free(), malloc(), realloc() -> 메모리 초기화 함수사용에 필요한 헤더파일 : string.h 사용함수 : memset() calloc() #include void *calloc(size..
Programming/C
2011. 10. 28. 01:11