• 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 Structs as objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C Structs as objects?


  • Subject: Re: C Structs as objects?
  • From: Finlay Dobbie <email@hidden>
  • Date: Wed, 17 Oct 2001 21:43:13 +0100

On Wednesday, October 17, 2001, at 09:52 pm, Ondra Cada wrote:

JLM> In C, IIRC, you could absolutely not assign a struct to a struct simply
JLM> by saying
JLM>
JLM> destStruct = srcStruct;

You don't remember correctly. Assignment (and returning, which is much more
complicated implementation-wise!!!) of structures (and unions, incidentally)
was part of ANSI C for years.

Also note that you can't do destObj = srcObj to make it copy all of the instance variables or anything... Since objects have to be dynamically allocated, you are probably just assigning addresses to pointers.

-- Finlay


References: 
 >Re: C Structs as objects? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: nobody knows, or just can't be done?
  • Next by Date: Re: cocoa-dev digest, Vol 1 #731 - 16 msgs
  • Previous by thread: Re: C Structs as objects?
  • Next by thread: RE: C Structs as objects?
  • Index(es):
    • Date
    • Thread