From: "doug" Newsgroups: comp.os.msdos.djgpp Subject: Re: djgpp strangeness Date: 23 Dec 1999 00:05:14 GMT Organization: none Lines: 39 Message-ID: <01bf4cda$41f7bec0$69247d81@doug> References: <14684.897$Qz2 DOT 16629 AT wagner DOT videotron DOT net> NNTP-Posting-Host: client36-105.oprit.rug.nl X-Trace: info.service.rug.nl 945907514 7979 129.125.36.105 (23 Dec 1999 00:05:14 GMT) X-Complaints-To: newsmaster AT rug DOT nl NNTP-Posting-Date: 23 Dec 1999 00:05:14 GMT X-Newsreader: Microsoft Internet News 4.70.1155 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Valkir schreef in artikel <14684.897$Qz2 DOT 16629 AT wagner DOT videotron DOT net>... > Here's the code: > int main() > {long x,y; > uchar *Video; > Buffer=(uchar *)malloc(1920000); > cVesa *Vesa=(cVesa *)malloc(sizeof(cVesa)); So Vesa is a pointer to some unknown struct to some allocated memory here. > Video=Vesa->InitVesa(); Maybe my brain is going funny here, but you are calling a function pointer that is part of the struct, but the struct has not been initialized yet. I take it that InitVesa is a function pointer that is part of the struct. Where is this InitVesa function and what does it look like? > //////// cDesktop *Deskt=(cDesktop *)malloc(sizeof(cDesktop)); > for(x=0;x<800;x++) > for(y=0;y<2400;y++) > *(Buffer+y*800+x)=x; > > memcpy(Video,Buffer,1920000); > getkey(); > Vesa->Close(); Another function call to the struct that is (as far as I can tell) is still unitialized, i.e. filled with garbage. > return(0); > } I hope this helps Doug Eleveld