• 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
sizeof a function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sizeof a function


  • Subject: sizeof a function
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 9 Nov 2010 00:06:29 +0700

These lines:

typedef char *(*my_type)(const char *, int);
my_type some = index;
fprintf(stderr,"sizeof(index): %lu\n", sizeof(index));
fprintf(stderr,"sizeof(some): %lu\n", sizeof(some));

produce:

sizeof(index): 1
sizeof(some): 8

This is x86_64 so the pointer-size should be 8 bytes. But why is the size of index = 1?

Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: sizeof a function
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: MKAnnotation coordinate
  • Next by Date: Re: NSTextFieldCell multi-line
  • Previous by thread: Re: MKAnnotation coordinate
  • Next by thread: Re: sizeof a function
  • Index(es):
    • Date
    • Thread