X-Originating-Host: 63.25.175.26 Organization: http://www.remarq.com: The World's Usenet/Discussions Start Here Subject: Pointers to stucts Lines: 34 From: Dogansmoobs Newsgroups: comp.os.msdos.djgpp Message-ID: <01414368.9f063b88@usw-ex0103-086.remarq.com> Bytes: 1160 X-Wren-Trace: eNXw2NnAh82Gkc7a0ZvH0cjJx8Pw2ZrX3djT2pLCw5iahcaaicCOio6Bn4KN Date: Sun, 28 May 2000 20:14:18 -0700 NNTP-Posting-Host: 10.0.2.86 X-Complaints-To: wrenabuse AT remarq DOT com X-Trace: WReNphoon4 959570149 10.0.2.86 (Sun, 28 May 2000 20:15:49 PDT) NNTP-Posting-Date: Sun, 28 May 2000 20:15:49 PDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com A while ago, I used to use Allegro. It was great, but I spent way too much time wondering, how does it do that? So one day, I decided to write my own library, right now only for mode 13h. It worked great, except for when I tried to pass a pointer to a stuct to a function. My bitmap stuce looks something like this: typedef struct bitmap { int width; int height; char *dat; } bitmap; If I pass the whole struct to a function, I can access it normally, but when I do it as allegro does, like this: bitmap *bmp; bmp = loadPcxFile("file.pcx"); In the loadPcxFile function, it always crashes on the line: bmp->width = width; and also in any function that tries to access the passed pointer to a bitmap, I get a page fault. Is there something really obvious that I'm missing here??? If there is, I'd really appreciate if you could call me stupid and tell me what I'm doing wrong. - Dogansmoobs I look exactly like a 15th centry explorer except completely differant. * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!