Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 879047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:51:55+00:00 2026-05-15T11:51:55+00:00

Please take a look at this macro. It is used in Symbian OS SDK,

  • 0

Please take a look at this macro. It is used in Symbian OS SDK, which compiler is based on GCC (< 4 version of it).

#ifndef _FOFF
#if __GNUC__ < 4
#define _FOFF(c,f)          (((TInt)&(((c *)0x1000)->f))-0x1000)
#else
#define _FOFF(c,f)          __builtin_offsetof(c,f)
#endif
#endif

I understand that it is calculating offset to specific class/struct member. But I cannot understand how that weird statement works – what is the constant 0x1000 and why is it there? Could somebody please explain this to me?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:51:56+00:00Added an answer on May 15, 2026 at 11:51 am

    “If there was a member of struct c starting exactly at the (perfectly-aligned;-) address 0x1000, then at what address would the struct’s member f be?” — answer: the offset you’re looking for, minus of course the hypothetical starting address 0x1000 for the struct… with the difference, AKA distance or offset, computed as integers, otherwise the automatic scaling in address arithmetic throws you off (whence the cast).

    What parts of the expression, specifically, are giving you problems?

    The inner part &(((c *)0x1000)->f) is “the address of member f of a hypothetical struct c located at 0x1000. Right in front of it is the cast (I assume TInt is some kind of integer type, of course), then the - 0x1000 to get the offset (AKA distance or difference between the address of the specific member of interest and the start of the whole structure).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please take a look at this example: #include <iostream> #include <vector> #include <string> using
Please take a look at this code: template<class T> class A { class base
Please take a look at this screenshot first: I would like to move the
Hi please take a look at this fiddle http://jsfiddle.net/bloodygeese/pwjNQ/1/ I am trying to figure
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
can someone take a look at this please http://jsfiddle.net/bloodygeese/ecscY/56/ it looks like I have
Please take a look at this page: http://www.carteadenisip.ro/partener/id-753.html - the image is not showing
Please take a look at this link , then click on the bottom in
Please take a look at this: http://halo.meredevelopment.co.uk/2011/11/creative-and-digital-media-apprenticeship/ The menu item 'Halo Home' has the
Please take a look at this piece of code. I'm allocating one byte for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.