Apr 8, 2016 at 11:21am UTC
Hello! Today I stepped on a brick of lego. While coding, "new" and "delete" both got greyed out.
In this part, "new d" is greyed out for some reason that I cannot find. I've stared for about an hour. Help!
this ->_categorySums = new double [this ->_nrOfCategories];
Last edited on Apr 8, 2016 at 11:22am UTC
Apr 8, 2016 at 1:03pm UTC
This sounds like a problem with your IDE. Since you haven't told us what the IDE is, it's going to be hard for anyone to know how to help.
I assume your compiler still compiles the code OK?
Apr 8, 2016 at 2:04pm UTC
As Mike says, what's the problem with grey? Would you like a different colour?
While I'm here, this sort of thing: this ->
is a bad idea. Don't do it.
this ->_categorySums = new double [this ->_nrOfCategories];
should be
_categorySums = new double [_nrOfCategories];
Apr 10, 2016 at 1:35pm UTC
I'm using visual studio 2015 community edition. Compiler compiles code but _categorySums does not get the value I want, it gets a -6.2774385622041925e+66 value instead of the array I assigned. Help!
It's like if it just skips that part of the code and gives it a trash value
Last edited on Apr 10, 2016 at 1:40pm UTC
Apr 10, 2016 at 3:50pm UTC
I was just dumb. It's all fixed now! Thanks to all anyway!