• 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: Rua Haszard Morris <email@hidden>
  • Date: Mon, 16 Oct 2006 12:23:43 +1300

quick hasty chime in:

'View memory as..' pointer to type, i.e. int*, should do it.

?

On 16/10/2006, at 12:02 PM, Justin C. Walker wrote:


On Oct 15, 2006, at 15:52 , Michael wrote:


The compiler does this, not the debugger. In C, arrays *are* pointers; they really aren't "first-class types".

Yes..I realize I misspoke. But, nonetheless, it still begs the question of whether it is possible to follow an array in "sub_function_main" when the array is initialized in "main".
All I see is a pointer to the array, even though I pass the array to the sub_function.

I can't tell if you understand the issue yet. You are not passing the array to the subfunction; you are passing a pointer to the array to the subfunction. In C, non-basic types are passed by reference, not by value. This means that all you get, in the subfunction, is a pointer to the array 'i'. That's the language.


I don't know a way to easily get gdb to print a structured version of an array from a pointer, but gdb is pretty flexible, so you may be able to do it (try 'help' and follow your nose) (or hold it :-}).

Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
-----------
If it weren't for carbon-14, I wouldn't date at all.
-----------


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40adinstruments.com


This email sent to email@hidden

_______________________________________________ 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
  • Follow-Ups:
    • Re: Re: Pointers and arrays
      • From: "Mark Wagner" <email@hidden>
References: 
 >Pointers and arrays (From: "Michael" <email@hidden>)
 >Re: Pointers and arrays (From: Laurence Harris <email@hidden>)
 >Re: Pointers and arrays (From: "Michael" <email@hidden>)
 >Re: Pointers and arrays (From: "Justin C. Walker" <email@hidden>)
 >Re: Pointers and arrays (From: Michael <email@hidden>)
 >Re: Pointers and arrays (From: "Justin C. Walker" <email@hidden>)

  • Prev by Date: Re: Pointers and arrays
  • Next by Date: Project leakage
  • Previous by thread: Re: Pointers and arrays
  • Next by thread: Re: Re: Pointers and arrays
  • Index(es):
    • Date
    • Thread