• 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: C to Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C to Objective-C


  • Subject: Re: C to Objective-C
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Fri, 4 Oct 2002 11:17:55 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Friday, Oct 4, 2002, at 10:56 US/Eastern, Jon wrote:

Hi,
How do I write this C call in Cocoa?

/* sample */
float Y[2];
float X[2];

X[0] = 5;
X[1] = 1;
Y[0] = 2;
X[1] = 3;

vertices(X, Y, 2);

/* Other file */

void vertices(float xVert[], float yVert[], int TOTAL)
{
int i;
for(i=0; i < TOTAL; i++) {
glTranslatef(xVert[i], yVert[i], 0.0);
}
}

I've tried - (void)verticesX:(float)xVert[] Y:yVert[]
T:(int)TOTAL; but this doesn't work in Cocoa. How
should I write it in Objective-C?

How about:

- - (void)verticesX:(float*)xVert Y:(float*)yVert T:(int)TOTAL;

Or, even better:

- - (void)verticesX:(const float*)xVert Y:(const float*)yVert T:(size_t)TOTAL;

- -- http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iEYEARECAAYFAj2dsSkACgkQd6STocYT1xXGxQCeKhGyGuI8+cgXN4VjF4/U9xxz
T/AAnj1nSUmErnsgL5xI2KKO1PuWcYCp
=6p6h
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: C to Objective-C
      • From: Ondra Cada <email@hidden>
References: 
 >C to Objective-C (From: Jon <email@hidden>)

  • Prev by Date: Re: Selector callback
  • Next by Date: resizing non 8-bit per component images
  • Previous by thread: Re: C to Objective-C
  • Next by thread: Re: C to Objective-C
  • Index(es):
    • Date
    • Thread