Mail Archives: djgpp/1999/11/05/20:42:04
You must dereference a pointer to convert it to the type of value to
which it points. Building on your example, you should call draw_vimg
with:
draw_vimg(*mygraphic, 200, 100, 1, 1);
Hope this helps.
Davin.
On Fri, 05 Nov 1999 19:26:56 GMT, "Philip Bock" <philipb AT escape DOT ca>
wrote:
>I have a function whose definition looks like this: (vimg is a struct)
>
> void draw_vimg(vimg vectimg, int x, int y, int xscale, int yscale);
>
>I want to pass it a vimg defined like so: (gen_vimg creates and sets initail
>values for the struct)
>
> vimg *mygraphic;
> mygraphic = gen_vimg();
>
>So I call draw_vimg like this:
>
> draw_vimg(mygraphic, 200, 100, 1, 1);
>
>And I get errors like this:
>
> vector.cpp: In function `int main()':
> vector.cpp:45: conversion from `vimg *' to non-scalar type `vimg'
>requested
__________________________________________________________
*** davmac - sharkin'!! davmac AT iname DOT com ***
my programming page: http://yoyo.cc.monash.edu.au/~davmac/
- Raw text -