• 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
Obj-C/C question (basic?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Obj-C/C question (basic?)


  • Subject: Obj-C/C question (basic?)
  • From: Hisaoki Nishida <email@hidden>
  • Date: Sat, 19 Oct 2002 03:33:45 -0400

Hi,

I need some quick help with my code.
The solution may be pretty basic..

There's a method with the prototype:

int someCmethod(struct foo *arg);

Obviously I need to pass it the address of myStruct.
But myStruct is of type struct bar, which is of the same size as struct foo.
So I cast it (i am talking about sockaddr_in and sockaddr, if you know these structs in C):

int a = someCmethod((struct foo *)&myStruct);

But what if I want to pass it a return value from my obj-c method:
- (struct bar *)objcmethod;

How would I put the return value directly in someCmethod?

int a = someCmethod((struct foo *)*[someobj objcmethod]);

That wouldnt work... would it?

Help greatly appreciated.

-Yuki
_______________________________________________
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: Obj-C/C question (basic?)
      • From: Ondra Cada <email@hidden>
    • Re: Obj-C/C question (basic?)
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: [Q] Determining startup volume
  • Next by Date: Re: Obj-C/C question (basic?)
  • Previous by thread: [A] Determining startup volume
  • Next by thread: Re: Obj-C/C question (basic?)
  • Index(es):
    • Date
    • Thread