🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #127

Found problem (memory model question)

#127
From: Raoul Said
Date: Wed, 22 Jul 1992 04:10
17 lines
998 bytes
	Ok, i have located the source of my problems after converting my code
from small to compact in Turbo C++.  Maybe I am missing something simple here
but how come the following code produces two identical pointers?  Am I doing
something I shouldn't be here?  All I want is two pointers to the near heap
while in the compact memory model.  When I run this code, my machine produces
two pointers that point to the same place in memory.  Any ideas??

void main()
{
char near 	*foo[2];

	foo[0] = (char near *)malloc(6);
	foo[1] = (char near *)malloc(6);
}

			Thanks
Technical Details
Message-ID: <1992Jul22.041040.28516@CS.ORST.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!orstcs!orstcs!usenetusenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!orstcs!orstcs!usenetusenet
From: saidra@prism.CS.ORST.EDU (Raoul Said)
Newsgroups: rec.games.programmer
Subject: Found problem (memory model question)
Message-ID: <1992Jul22.041040.28516@CS.ORST.EDU>
Date: 22 Jul 92 04:10:40 GMT
Sender: usenet@CS.ORST.EDU
Organization: Oregon State University, Computer Science Dept.
Lines: 17
Nntp-Posting-Host: prism.cs.orst.edu