Path: utzoo!attcan!uunet!husc6!spdcc!merk!alliant!linus!mbunix!duncant From: duncant@mbunix.mitre.org (Thomson) Newsgroups: comp.sys.amiga.tech Subject: Re: Memory allocation Keywords: stack size, heap, Lattice 5.04 Message-ID: <88515@linus.UUCP> Date: 12 Jan 90 04:50:54 GMT Sender: news@linus.UUCP Reply-To: duncant@mbunix.mitre.org (Thomson) Organization: The MITRE Corp. Bedford, MA Lines: 14 Regarding the problem of stack usage with recursive functions, note that it is possible to use static allocation of data structures with recursive functions, as long as the usage of the data structure does not span a recur- sive call. In the copyfile() example under consideration, it would appear to be safe to allocate buff[ ... ] outside the function. This would solve your stack overflow problems without any major code changes. Duncan Thomson P.S. I think the best book for learning C programming, on the Amiga as well as on any other system, is the Kernighan and Ritchie classic, "The C Programming Language."