R
raghuv119
what am I doing wrong here. on a 64 bit m/c if I just do g++ t.cpp
everything works find. if I do g++ -m32 t.cpp it just breaks.
====================
#include <iostream>
static int mcount = 0;
using namespace std;
class Base
{
public:
Base( int i, int j) { cout <<i<<"\t"<<j<<endl; };
virtual ~Base() { };
virtual void hui() { cout <<"hello world"<<endl; };
protected:
int temp12;
};
class Child : public Base
{
public:
Child(int i, int j) : Base(i,j) {};
~Child() {};
virtual void hui() { cout <<"world hello world"<<endl; };
protected:
int temp23;
};
int main(int argc, char **argv)
{
Base *temp = new Child [16384] (3, 2);
temp[0].hui();
delete [] temp;
}
everything works find. if I do g++ -m32 t.cpp it just breaks.
====================
#include <iostream>
static int mcount = 0;
using namespace std;
class Base
{
public:
Base( int i, int j) { cout <<i<<"\t"<<j<<endl; };
virtual ~Base() { };
virtual void hui() { cout <<"hello world"<<endl; };
protected:
int temp12;
};
class Child : public Base
{
public:
Child(int i, int j) : Base(i,j) {};
~Child() {};
virtual void hui() { cout <<"world hello world"<<endl; };
protected:
int temp23;
};
int main(int argc, char **argv)
{
Base *temp = new Child [16384] (3, 2);
temp[0].hui();
delete [] temp;
}