Article View: comp.lang.c.moderated
Article #2373Re: Newbie Question: Multiple indirection
From: Erik Anderson
Date: Sun, 24 Mar 1996 17:43
Date: Sun, 24 Mar 1996 17:43
17 lines
1368 bytes
1368 bytes
In article <4j06lv$7ve@solutions.solon.com>, cn3780@coastalnet.com (Terry Heath) wrote: >I have seen many references in text I have read about multiple >indirection (i.e. **p); I seen how to initilize them and so on. The >question is: > > Why would it be necessary to use such a pointer, and when? Multiple indirection is usually needed when you are changing a pointer from within a function. For example, if you were to open a FILE from inside a function, you would need pass to it a double-pointer, so that the changes can escape. Also, if you are dealing with a linked list, and you are calling a function that may change what the head of the list is, then you are also going to have to pass a double pointer. Another reason for using multiple indirection is when you are dynamically allocating your own multi-dimentional array.
Technical Details
Message-ID:
<4j41j6$nmu@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4j06lv$7ve@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: ebanders@tiabyte.telebyte.com (Erik Anderson) Newsgroups: comp.lang.c.moderated Subject: Re: Newbie Question: Multiple indirection Date: 24 Mar 1996 11:43:02 -0600 Organization: Telebyte North West Silverdale, Wa Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4j41j6$nmu@solutions.solon.com> References: <4j06lv$7ve@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Newsreader: News Xpress Version 1.0 Beta #4