TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: ``TICAL``
from: WILLIAM MCBRINE
date: 1998-04-09 01:00:00
subject: [03/4] CritErr handler

-=> ``Tical`` wrote to Paul Druggitt <=-
 ``> This is a C++ question
Not really... this works in C, too. :-)
 ``> I was reading in a C++ book that inside of structures, you can
 ``> define data types of that structure... Like so:
 ``> 
 ``> struct list
 ``> { char monkey;
 ``>   list *list;
            ^
            |- notice this!
 ``>   list *invertebrate;
 ``>   int  beligerant;
 ``> }
What you've done is not to declare a structure within itself, but rather a
*pointer* to a structure of that type. Storage must be allocated to those
pointers manually, via "malloc" (for C) or "new" (for C++). That's how
lists are built.
 ``> it seems that some sort of infinite loop would be created because the
 ``> structure would be creating variables of that structure which, in 
 ``> turn, would create more variables of that structure, etc., etc.
Since they're only pointers, not structures, there's no automatic
recursion in their creation.
... Data, data everywhere, and not a byte to eat!
---
1:109/570)
---------------
* Origin: * My Place BBS * Bowie, Md USA * V.34 * (301)805-1602 *

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.