Hello,
in my code I define a struct like this:
Individuals *individuals = NULL;
individuals = malloc(10*sizeof(Individuals));
When debugging, I know how to watch one individual at a time, by Right click > Adding watch > individuals[3] for example.
But I would like to be able to follow easily the values in every structure in individuals, ie individuals[0], individuals[1], etc... on the same screen (like what I've seen XCode is doing).
Is there a way to do that?
Thanks.
I guess you mean Right click -> Edit watch -> Watch as array?
So yes I've tried, when I do this I obtain
*individuals
[0] offer
[1] request
[2] strength
...
instead of
*individuals
offer
request
strength
...
but still not what I want:
individuals[1] individuals[2] ...
offer offer ...
request request ...
strength strength ...
It seems like the watch *individuals only shows individuals[0]
It seems like the watch *individuals only shows individuals[0]
Which is actually correct. NOte that C -arrays are not real arrays/vectors. The name of the C-arrays decays into a pointer to the type ==> *individuals is then actually the same as :
int * foo = new int();
*foo; // <-- same thing here