I have a class with a constructor, but everytime i run, it crashes, with a
"raised exception...blah lah blah", erorr.
Here is the code
It crashes at the "TImage *Ship_Sprite = new TImage(Form1);" line.Code:#ifndef SHIPH #define SHIPH class Ship { public: int health; int x1; int y1; TImage *Ship_Sprite; Ship(); }; Ship::Ship() { TImage *Ship_Sprite = new TImage(Form1); health = 100; Ship_Sprite->Picture->LoadFromFile("ship-1.bmp"); x1 = 10; y1 = 20; } #endif
thx