Re: C to Objective-C
Re: C to Objective-C
- Subject: Re: C to Objective-C
- From: Thomas Castiglione <email@hidden>
- Date: Fri, 4 Oct 2002 23:13:42 +0800
On Friday, October 4, 2002, at 10:56 PM, 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);
}
}
Well, first of all, that will still work - you can use C code,
unmodified, in Cocoa if you so desire.
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?
- (void)verticesX:(float *)xVert Y:(float *)yVert T:(int)TOTAL; should
work.
- Thomas Castigllione
_______________________________________________
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.