Re: dynamically allocating arrays of type double
Re: dynamically allocating arrays of type double
- Subject: Re: dynamically allocating arrays of type double
- From: Greg <email@hidden>
- Date: Fri, 15 Apr 2005 19:46:40 +1000
values = (double **)malloc(sizeof(double));
memset(0,sizeof(double) * r * c, values);
I typed it in mail so the parameters for memset might be wrong.
Greg
On 15/04/2005, at 7:29 PM, Aaron Boothello wrote:
Im writing an openGL program and i need to be able to handle
transformation matrices, best represented by arrays of type double.
The matrices vary in size depending on the situation, so i was wonder
... how do i go about declaring and creating these dynamic arrays in
objective-C ?
example(psudo):
matrix:NSObject
{
int rows, columns;
double values[rows][columns]; //rows and columns set in the iit method
when a new matrix is created
}
-(id) initWithDimensions:(int)r :(int)c
{
rows = r;
columns = c;
(how do i initialize the array's values)
}
Thanks,
Aaron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden