Re: return pointer to a 2d aray
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