• 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: return pointer to a 2d aray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return pointer to a 2d aray


  • Subject: Re: return pointer to a 2d aray
  • From: David Spooner <email@hidden>
  • Date: Mon, 12 Nov 2007 15:41:05 -0700

Jason,

You have to change your method return type to uint16_t *. If you need the return type to be uint16_t ** then you would need to change your internal representation, perhaps adding the following instance variable

    uint16_t **rows;

and initializing it as described earlier today.

dave


On 12-Nov-07, at 3:28 PM, Jason Horn wrote:

Hi List,

On a related question to my last one, how do you return a pointer to a 2d array from an object's method? For example, the class below contains an instance variable that is a 2d array.

Thanks,

- Jason


// MyClass.h @interface MyClass : NSObject { uint16_t pixels[480][640]; }

- (uint16_t **)pixels; // What goes here? This isn't right, I've tried it.
@end




// MyClass.m
@implementation Image

- (uint16_t **)pixels 	// And what goes here?
{
	return pixels;
}

@end
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >return pointer to a 2d aray (From: Jason Horn <email@hidden>)

  • Prev by Date: [Moderator] Re: Licensing my Application
  • Next by Date: Re: How to archive structs like NSRect
  • Previous by thread: return pointer to a 2d aray
  • Next by thread: Spewing stderr to an NSTextView
  • Index(es):
    • Date
    • Thread