Mail Archives: djgpp/1999/08/08/11:52:09
he he, nevermind, I understand... that was dumb.
-Josh de Bever
YUBS <jdebever1 AT home DOT com> wrote in message
news:Lg8r3.7464$K%6 DOT 153853 AT news1 DOT rdc2 DOT on DOT home DOT com...
> Hey guys, thanks a lot! I was pretty messed up there, but it all makes
sense
> now. Thanks for showing me the light so quickly. Just another question,
> Horst, you used a local helper variable "p" and cast it before using it,
but
> I was just wondering what the difference between casting something like
> this:
>
> pcx_picture_ptr p = image;
>
> versus casting it like this:
>
> (pcx_picture_ptr)p = image;
>
> The first way works and the second way doesn't thats all I know, but I've
> always casted variables as in the second method. What's up? Is the first
way
> permanent and the second only for that call or what? Thanks a lot, and I
> appreciate the help you've already given...
>
> -Josh de Bever
>
>
>
>
>
> Horst Kraemer <horst DOT kraemer AT snafu DOT de> wrote in message
> news:37abee37 DOT 246073100 AT news DOT snafu DOT de...
> > On Sat, 07 Aug 1999 07:04:36 GMT, "YUBS" <jdebever1 AT home DOT com> wrote:
> >
> > > Hi, I'm having some trouble using void pointers. I'm writing a
function
> that
> > > will allocate enough memory for any of my types by using a void
pointer
> as a
> > > parameter in the function. I.e.
> >
> > > void pcx_init (void *image, char type)
> >
> > > So say I have the following type:
> >
> >
> > > typdef struct pcx_image_typ
> > > {
> > > char *buffer;
> > > int width, height;
> > > } pcx_image, *pcx_image_ptr
> >
> >
> > > I want to be able to pass a pointer to a variable of type pcx_image to
> > > pcx_init and have it allocate width*height memory for buffer. The
> problem
> > > I'm getting is that DJGPP keeps complaining that I'm "dereferencing
> "void *"
> > >
- Raw text -