www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/13/04:22:08

From: "Thomas Harte" <T DOT Harte AT btinternet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: More malloc troubles
Date: 12 Dec 1996 19:33:22 GMT
Organization: Dell Computer Corporation
Lines: 20
Message-ID: <01bbe862$3b6f2780$312549c2@default>
NNTP-Posting-Host: host-73-37-49.btinternet.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

	All right, thanks to all those who helped me last time, but I'm still
having problems. In DJGPP, before main(), I declare these variables as
global:-

unsigned char *vbuf ;         
unsigned char *doublebuffer ; 
unsigned char *background ;   

	Then, soon as the program starts, I do this :-

 unsigned char *vbuf = (unsigned char *)malloc(64000);         
 unsigned char *doublebuffer = (unsigned char *)malloc(64000); 
 unsigned char *background = (unsigned char *)malloc(64000);   

	But, it causes a general protection fault every single time! I know I am
in-experienced, but surely there is something seriously wrong here? It
compiles without errors but brings down DOS every single time.
	Once again, thanking people in advance,

		-Thomas

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019