www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/03/19:48:31

From: Jeff Weeks <pweeks AT execulink DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: pointer trouble... need help
Date: 3 Mar 1997 22:54:16 GMT
Organization: Internet News Service
Lines: 30
Message-ID: <5ffkqo$gu2@nr1.toronto.istar.net>
References: <5f9tk7$2mg AT nr1 DOT toronto DOT istar DOT net> <331883e5 DOT 3893533 AT ursa DOT smsu DOT edu>
NNTP-Posting-Host: news.linkd.net
Mime-Version: 1.0
XPident: Unknown
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> >tbuf *buf_data;
> >bbuf *buf_data;
> 
> I'm not very familar with C++.  However, the above two points (in C) should be:
> 
> buf_data        *tbuf;
> buf_data        *bbuf;

Doe!  He he... I must have been out to lunch when I typed up this
message :)

> tbuf = bbuf will merely have two pointers to the same memory.  This will not
> copy the contents pointed to by bbuff into the memory allocated by new.  In
> fact, the memory allocated by the second new will no longer be accessable at
> all.  To copy memory blocks, the easiest way to is use one of the memory copy
> functions such as memcpy(tbuf,bbuff,video.max_x);

To slow for what I'm doing... it turns out I have it right afterall :) 
The thing is, I needed to swap tbuf and bbuf... not just assign bbuf to
tbuf... stupid mistake!

Jeff Weeks

--------------------------------------------
            - Code X Software -
       Programming to a Higher Power
  
  email: mailto:pweeks AT execulink DOT com
  web:	 http://www.execulink.com/~pweeks/
--------------------------------------------

- Raw text -


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