Debugging C programs in XCode

Joined
Feb 2, 2011
Messages
1
Reaction score
0
Points
1
Greetings all,

I programmed for years in Code Warrior. My last computer that can still run CW is dying, and I'm trying to make the jump to XCode.

One issue that is badly thwarting me when debugging is seeing the values within memory-allocated arrays and matrices. Most of the programs I write set these up based on data files that vary substantially in dimensions. Thus, I use commands like:
int *v = (int*)malloc(length * sizeof (int));​
to create an array of length "sizeof".

My problem is that I can find no way to see the value of v[1], v[2], etc. (Many of my programs involve simulations, and before they are fully debugged, I wind up putting incorrect values into this array that subsequently causes a memory error in another array or matrix.)


Is there a simple way to do this? If not, then is there even a hard way to do this? :Cool:


Many thanks.


EDIT: And, yes, I am a bit of a dinosaur when it comes to coding.....
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top