Archived

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

Jeff D

Making a dynamic array

Recommended Posts

Ok I got my graphics engine with this in it: CHAR_INFO *m_pciMainScreen; so in a member function of that class I did this: m_pciMainScreen = new CHAR_INFO[m_cdScreenSize.X * m_cdScreenSize.Y] m_cdScreenSize is a COORD struct now my question is where do I put the brackets for the array part I tried: m_pciMainScreen[0]->Char.AsciiChar = ''A'' but that doesn''t seem to work. I tried many other places and nothing works to well. Any help would be appreciated. Jeff D

Share this post


Link to post
Share on other sites
Im getting a little better I tried this:

(*m_pciMainScreen[0]).Char.AsciiChar = 218;

and it looks a little better I just get this now:
--------------------Configuration: Anshure - Win32 Debug--------------------
Compiling...
GraphicEngine.cpp
C:\Windows\Desktop\Projects\Anshure\GraphicEngine.cpp(62) : error C2100: illegal indirection
C:\Windows\Desktop\Projects\Anshure\GraphicEngine.cpp(62) : warning C4305: ''='' : truncation from ''const int'' to ''char''
C:\Windows\Desktop\Projects\Anshure\GraphicEngine.cpp(62) : warning C4309: ''='' : truncation of constant value
Error executing cl.exe.

Anshure.exe - 1 error(s), 2 warning(s)

Jeff D

Share this post


Link to post
Share on other sites
No need to help I fixed it on my own all I had to do was:

(m_pciMainScreen[0]).Char.AsciiChar = 218;

I think Im starting to get the hang of this!

Jeff D



Edited by - Jeff D on February 17, 2002 11:32:13 PM

Share this post


Link to post
Share on other sites