comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » pointers in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Pointers in IDL [message #39015 is a reply to message #8813] Wed, 14 April 2004 07:55 Go to previous messageGo to previous message
Peter Clinch is currently offline  Peter Clinch
Messages: 98
Registered: April 1996
Member
Benjamin Hornberger wrote:

> 1. What are null pointers for?

Primarily as checks and balances, I think. If you check a pointer
before use and find it's null then you know you shouldn't be using it,
so it helps writing robust code.

So, for example, in a linked list where the last thing in the list
element structure is a pointer to the next element, the last element's
pointer to the "next" element would be a null (there is no next at the
end of the list). Traversing the list, you'd check what the next
element is, and finding it's a null you'd abandon the list traverse
knowing you'd got to the end.

Pete.
--
Peter Clinch University of Dundee
Tel 44 1382 660111 ext. 33637 Medical Physics, Ninewells Hospital
Fax 44 1382 640177 Dundee DD1 9SY Scotland UK
net p.j.clinch@dundee.ac.uk http://www.dundee.ac.uk/~pjclinch/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Realizing a widget only once
Next Topic: reading pixels from images from automated XYpositions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 11:06:19 PDT 2025

Total time taken to generate the page: 1.36002 seconds