Click here to Skip to main content
15,894,540 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dynamic allocation of arrays Pin
Sauce!28-Sep-08 19:28
Sauce!28-Sep-08 19:28 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!29-Sep-08 21:01
Sauce!29-Sep-08 21:01 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 0:20
Iain Clarke, Warrior Programmer30-Sep-08 0:20 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 0:55
Sauce!30-Sep-08 0:55 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 1:25
Iain Clarke, Warrior Programmer30-Sep-08 1:25 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 1:34
Sauce!30-Sep-08 1:34 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 1:48
Iain Clarke, Warrior Programmer30-Sep-08 1:48 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 2:16
Sauce!30-Sep-08 2:16 
Oh dear, I am so silly :P

That ought to teach me not to reuse old code that has never been tested.

It was simply a pointer to a static int (that was supposed to be) declared in the tile class. Stupid me, put it outside of the tile class for some unknown reason, which made it inaccessible to the Tile class. D'Oh! | :doh:

Unfortunately though, removing it doesn't fix the problem Frown | :(

I will try what you said and get back to you, though for the mean time I have another question: How do you use a static variable to count the number of classes you have? I can do everything but initialise the variable - C++ simply doesn't let you initialise non const member variables within a class, so where am i supposed to initialise the count to 0? Take the following code as an example;

class theClass
{
public:
theClass(void);
~theClass(void);

private:
static int theCount = 0; //Error!
};

theClass::theClass()
{
theCount++
}

theClass::~theClass()
{
theCount--
}

GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 3:21
Iain Clarke, Warrior Programmer30-Sep-08 3:21 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!30-Sep-08 5:01
Sauce!30-Sep-08 5:01 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 5:31
Iain Clarke, Warrior Programmer30-Sep-08 5:31 
GeneralRe: dynamic allocation of arrays Pin
Sauce!30-Sep-08 5:43
Sauce!30-Sep-08 5:43 
GeneralRe: dynamic allocation of arrays Pin
Iain Clarke, Warrior Programmer30-Sep-08 6:02
Iain Clarke, Warrior Programmer30-Sep-08 6:02 
GeneralRe: dynamic allocation of arrays Pin
Sauce!2-Oct-08 5:05
Sauce!2-Oct-08 5:05 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!4-Oct-08 2:42
Sauce!4-Oct-08 2:42 
GeneralRe: dynamic allocation of arrays Pin
Sauce!4-Oct-08 5:19
Sauce!4-Oct-08 5:19 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!4-Oct-08 5:34
Sauce!4-Oct-08 5:34 
GeneralRe: dynamic allocation of arrays [modified] Pin
Sauce!4-Oct-08 12:53
Sauce!4-Oct-08 12:53 
GeneralRe: dynamic allocation of arrays Pin
Sauce!17-Oct-08 20:58
Sauce!17-Oct-08 20:58 
Questionno WM_MOUSEHOVER in an edit Pin
followait28-Sep-08 18:58
followait28-Sep-08 18:58 
AnswerRe: no WM_MOUSEHOVER in an edit Pin
Iain Clarke, Warrior Programmer30-Sep-08 0:25
Iain Clarke, Warrior Programmer30-Sep-08 0:25 
QuestionCListCtrl Problem Pin
Dhiraj kumar Saini28-Sep-08 18:53
Dhiraj kumar Saini28-Sep-08 18:53 
AnswerRe: CListCtrl Problem Pin
_AnsHUMAN_ 28-Sep-08 18:59
_AnsHUMAN_ 28-Sep-08 18:59 
AnswerRe: CListCtrl Problem Pin
Naveen28-Sep-08 19:01
Naveen28-Sep-08 19:01 
QuestionWrite a buffer to stringstream Pin
CodingLover28-Sep-08 18:43
CodingLover28-Sep-08 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.