Mail Archives: djgpp/1998/10/09/13:51:36
You can't put functions inside structs in c, but you can put them inside
classes in c++. I think the function is called class, but I don't do
c++ so I can't be sure. Apart from replacing struct with class, it
looks ok.
Peter Allen
Twidler wrote:
>
> Does DJGPP support structures. How about procedures in structures?
>
> I tried this in DJGPP:
>
> typedef struct NICEDOGY
> {
> int x, y;
> int w h;
>
> int Draw_It()
> {
> x=w;
> y=h;
> }
> }NICEDOGY;
>
> and it didnt work...it gave me some errors at the Draw_It() procedure.
> what is going on here? How do I fix this without putting the Draw_It()
> procedure outside of the structure?
>
> Twidler
- Raw text -