typedef struct ProbWays
double *probs ;
int length ;
ProbWays *ways = new ProbWays;
ways->probs = new double;
ways->length = 4 ;
delete ways ;
why this delete ways does not work , it causes heap error?
Line 8 doesn't even compile: you have to specify the size of the array.
Because ways is an array, you should change line 11 to
delete  ways;. Also you forgot to delete
Topic archived. No new replies allowed.