🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #9114

Re: Novice Programmer Question: Dynamic Memory Allocation under TC

#9114
From: D. K. Smith
Date: Fri, 08 Dec 1989 05:31
17 lines
1331 bytes
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__________________________________________________________
Technical Details
Message-ID: <1989Dec8.053119.28475@ncsuvx.ncsu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!asuvax!ncar!mephisto!ncsuvx!news
References: <24770@cup.portal.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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