• 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: Static data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static data?


  • Subject: Re: Static data?
  • From: Markus Hitter <email@hidden>
  • Date: Tue, 6 Jul 2004 22:24:29 +0200

Am 03.07.2004 um 17:03 schrieb Allan Odgaard:

On 3. Jul 2004, at 11:26, Markus Hitter wrote:

There are cases where this transformation cannot happen, like:
    long data[1024][1024];
->
    data = ...?

From the C-FAQ (<http://www.faqs.org/faqs/C-faq/faq/>) 6.16:

	int **array1 = malloc(nrows * sizeof(int *));
	for(i = 0; i < nrows; i++)
	  array1[i] = malloc(ncolumns * sizeof(int));
	...

... the elements of the dynamic array can be accessed with normal-looking array subscripts: arrayx[i][j]


The advantage of static or automatic storage (as opposed to heap allocated storage) is that you do *not* need to handle errors, cause there will be none, ...

The errors appear at app launch time. Even more likely as malloc(), as there are tighter limitations.



Cheers, Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Static data?
      • From: Allan Odgaard <email@hidden>
References: 
 >Static data? (From: "Christopher Beck" <email@hidden>)
 >Re: Static data? (From: Pavol Markovic <email@hidden>)
 >Re: Static data? (From: Markus Hitter <email@hidden>)

  • Prev by Date: Re: Static data -- thanks
  • Next by Date: Re: Static data?
  • Previous by thread: Re: Static data?
  • Next by thread: Re: Static data?
  • Index(es):
    • Date
    • Thread