출처 http://c-faq.com

Q: What are pointers really good for, anyway?

   

A: They're good for lots of things, such as:

  • dynamically-allocated arrays (see questions 6.14 and 6.16)
  • generic access to several similar variables
  • (simulated) by-reference function parameters (see question 4.8 and 20.1)
  • malloc'ed data structures of all kinds, especially trees and linked lists
  • walking over arrays (for example, while parsing strings)
  • efficient, by-reference ``copies'' of arrays and structures, especially as function parameters

(Note that this is hardly a comprehensive list!)

See also question 6.8.

   

    

반응형

'Language > C' 카테고리의 다른 글

C FAQ (포인터 증가 2)  (6) 2012.07.12
C FAQ (포인터 증가에 대해서)  (6) 2012.07.12
C FAQ (malloc 오류)  (6) 2012.07.12
C FAQ (포인터 선언 에러)  (6) 2012.07.12
mkfifo 함수 예제  (10) 2012.07.06

+ Recent posts