• 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: dynamically allocating arrays of type double
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: dynamically allocating arrays of type double
      • From: Scott Ribe <email@hidden>
References: 
 >dynamically allocating arrays of type double (From: Aaron Boothello <email@hidden>)

  • Prev by Date: dynamically allocating arrays of type double
  • Next by Date: Re: parameterized object creation
  • Previous by thread: dynamically allocating arrays of type double
  • Next by thread: Re: dynamically allocating arrays of type double
  • Index(es):
    • Date
    • Thread