Xref: utzoo comp.sys.mac:43757 comp.sys.mac.programmer:11001 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!asuvax!ncar!mephisto!ncsuvx!news From: dks@shumv1.uucp (D. K. Smith) Newsgroups: comp.sys.mac,comp.sys.mac.programmer Subject: Re: Novice Programmer Question: Dynamic Memory Allocation under TC Message-ID: <1989Dec8.053119.28475@ncsuvx.ncsu.edu> Date: 8 Dec 89 05:31:19 GMT References: <24770@cup.portal.com> Sender: news@ncsuvx.ncsu.edu (USENET News System) Reply-To: dks@shumv1.ncsu.edu (D. K. Smith) Distribution: usa Organization: NCSU Computing Center Lines: 17 From a novice to a novice: I was recently using the TC and their unix shell environment to write a program for school. My bug was due to some arithmetic I was performing to calculate the address of my next struct member. If you are doing a "straight" list implementation then this is probably not your problem. (but in the event it relates...) The thing that tripped me up was my cast of the pointer before I did the math on it. I cast it as unsigned when it should have been unsigned long. (i.e. the top of my l.word was being chopped off.) The symptom to this problem was a linked list going ALL OVER THE PLACE. Hope this helps... if it doesn't, oh well. dk smith__________________________________________________________