   vfptr misaligned
  I'm allocating an array of a child class from a base class ptr.  I'm finding that the vfptr in my array (starting at index 1) is off by the amount of the extra data members in my child (8 bytes in the example below).I read that unterminated #pragma pack(push, 1)/#pragma(pop) can cause this (I do use this, makes no difference if I remove it), and also inconsistent project settings if you have mulitple projects can cause this as well.  I've been over things a few times, but am stumped.Was wondering if anyone has had this problem or ideas.  This is an app using directx and some basic headers like stdio.h, string.h, etc.class base{public:  base();};class child{public:  child();protected:  int someVars;  int someMoreVars;};/// In code somewherebase* myArray = child[10];
  It sounds like you're trying to pretend an array of 'derived' is an array of 'base'. You can't do that.To have an array where each element has an known type but is derived from base, you need to use an array of pointers, where each element points to an object of unknown type:base **base_array = new base *[num_elements];base_array[0] = new derived;..base_array[num_elements - 1] = new derived;It'd be better to just use a vector (or list, or set, or whatever) of pointers, though.   ;  Ah ok.  Thanks!   