• 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: mixing c with obj c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mixing c with obj c


  • Subject: Re: mixing c with obj c
  • From: Ondra Cada <email@hidden>
  • Date: Sat, 13 Apr 2002 01:58:20 +0200

On Saturday, April 13, 2002, at 01:48 , Phillip Morelock wrote:

The thing is -- i don't want to declare a size (id foo[10]) because it's an
array-based implementation of a data structure...i need to be able to double
the array, obviously i just want a pointer.

Right. So declare one:

...
id *foo;
...

The usage is straighforward:

foo=calloc(number_of_elements,sizeof(*foo));
...
foo[N]=[NSObject new];
...
[foo[N] retain];
...
free(foo);
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: mixing c with obj c
      • From: Phillip Morelock <email@hidden>
References: 
 >mixing c with obj c (From: Phillip Morelock <email@hidden>)

  • Prev by Date: mixing c with obj c
  • Next by Date: Re: mixing c with obj c
  • Previous by thread: mixing c with obj c
  • Next by thread: Re: mixing c with obj c
  • Index(es):
    • Date
    • Thread