I am creating an indicator-to-pointer of a square object and when I create a new object using the pointer I try to make -faults. Why does this happen
structure level {int SoldierCount; Military ** soldier; Int taskCount; Int * taskPercentage; Int * taskBitmapX; Int * taskBitmAPY; } Level; Zero createMap () {// Input of different variables and Decclantian goes here. Level.soldier = new soldier * [level.SoldierCount]; // SEG flaw here level. Soldier [i] = new soldier (initX, initY, init direction, step); }
Manufacturer of Military Class:
Soldier (int, int, int, int); Your code works fine with
empty military
constructor (Except for the correct typo), such as lowercase level.soldier []
)
Please construct the constructor body.
Comments
Post a Comment