• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Pointers and arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pointers and arrays


  • Subject: Re: Pointers and arrays
  • From: Michael <email@hidden>
  • Date: Mon, 16 Oct 2006 15:08:14 -0700


On Oct 16, 2006, at 3:06 PM, Joachim Deelen wrote:
Hi!

consider the following code:

int main (int argc, const char * argv[]) {
    // insert code here...
	int i[10];
	sub(i);
    return 0;
}

void sub(int *aI) {
	int i;
	for (i = 0; i < 9; i++) {
		aI[i] = i;
	}
}

I think, you will watch how the array "aI" gets filled within the function "sub(int *aI)".

Set a breakpoint at "aI[i] = i". Then in the debugger Window, where the "int *" gets displayed with the address-value of "aI", open the Context-Menu and select "View Value as...". Change "int *" to "int [10] *" an press OK (replace [10] with your array size).

Now "aI" gets displayed in a separate Window. Select the small triangles, to open the tree. After opening the second triangle, you'll see all the elements of your array!

Hope this Helps


It does ...thanks.



Joachim



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Pointers and arrays (From: "Michael" <email@hidden>)
 >Re: Pointers and arrays (From: Joachim Deelen <email@hidden>)

  • Prev by Date: Re: Pointers and arrays
  • Next by Date: Re: Custom Data Formatters
  • Previous by thread: Re: Pointers and arrays
  • Next by thread: GDB "Error fixing MyObject.m: In function '-myMessage' argument 'self' changed from type 'class MyObject *' to type '<unknown type>', which is not supported"
  • Index(es):
    • Date
    • Thread