Re: C to Objective-C
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.