• 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: Ryan Stevens <email@hidden>
  • Date: Fri, 4 Oct 2002 08:29:58 -0700

Short answer, don't. You can call C functions from Obj-C code.

On Friday, October 4, 2002, at 07:56 AM, 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?

Thanks,
Jon
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
_______________________________________________
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.
_______________________________________________
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.

References: 
 >C to Objective-C (From: Jon <email@hidden>)

  • Prev by Date: resizing non 8-bit per component images
  • Next by Date: Re: NSNetService addresses returns empty array
  • Previous by thread: Re: C to Objective-C
  • Next by thread: Re: C to Objective-C
  • Index(es):
    • Date
    • Thread