Archived

This topic is now archived and is closed to further replies.

Viri-

Floating Flag/C++ Class question....

Recommended Posts

Viri-    122
Ok I was working with the NeXe tutorials and was workign with the Flag Tutorial. I changed a thing or two here and there and liked how it works and I've really wanted to have this effect saved so I could add it to my project any time I want. I have two files: Flag.h/.cpp And all is good. But then I changed some things around and now I get this error on my setup func: ...\main.cpp(56) : error C2664: 'SetupFlag' : cannot convert parameter 5 from 'class CFlagVertex (*)[400]' to 'class CFlagVertex *[]' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast What I have in my code is this: CFlag Flag; CFlagVertex pVertices[400]; ... // the func in the class (flag.h/.cpp) is: void SetupFlag(CDirect3D *pDirect3D, char *szTextName, CTexture *pCTexture, CVertexBuffer *pCVertBuff, CFlagVertex *pVertices[]); // the func in my main.cpp Flag.SetupFlag(&Direct3D, "nel.bmp", &pCTexture, &CVertBuff, &pVertices); What the problem is is that I have pVertices declared at 400 (ie: pVertices[400] and I want to be able to let the coder decide how big the flag and be able to pass it to the setup func so it will setup the points correctly. But I again get the error: 'class CFlagVertex (*)[400]' to 'class CFlagVertex *[]' What am I doing wrong or what do I need to do to fix this? If this just isn't clear let me know and I'll post more code and try again explaining it.. basicly I'm just trying to pass pVertices[400] into my function: FlagSetup(...CFlagVertex *pVertices) Thanks for any and all help... Edited by - Viri- on June 28, 2001 10:59:54 AM

Share this post


Link to post
Share on other sites