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 719915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:41:55+00:00 2026-05-14T05:41:55+00:00

I have a macro definition in header file like this: // header.h ARRAY_SZ(a) =

  • 0

I have a macro definition in header file like this:

// header.h
ARRAY_SZ(a) = ((int) sizeof(a)/sizeof(a[0]));

This is defined in some header file, which includes some more header files.

Now, i need to use this macro in some source file that has no other reason to include header.h or any other header files included in header.h, so should i redefine the macro in my source file or simply include the header file header.h.

Will the latter approach affect the code size/compile time (I think yes), or runtime (i think no)?

Your advice on this!

  • 1 1 Answer
  • 0 Views
  • 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-14T05:41:56+00:00Added an answer on May 14, 2026 at 5:41 am

    Include the header file or break it out into a smaller unit and include that in the original header and in your code.

    As for code size, unless your headers do something incredibly ill-advised, like declaring variables or defining functions, they should not affect the memory footprint much, if at all. They will affect your compile time to a certain degree as well as polluting your name space.

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

Sidebar

Ask A Question

Stats

  • Questions 489k
  • Answers 489k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer apparently 0.8.1 uses "gem bundle" rather than "bundle" May 16, 2026 at 9:06 am
  • Editorial Team
    Editorial Team added an answer You could use lookaheads to detect if the quotes that… May 16, 2026 at 9:06 am
  • Editorial Team
    Editorial Team added an answer $('#leftFrame')[0].contentWindow.document $('#leftFrame')[0].contentWindow.functionName() The above should work. jQuery's contents() only works… May 16, 2026 at 9:06 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a header file with about 400 function declarations and its corresponding source
I have a class with a static method that looks roughly like: class X
I am attempting to alter an IAR specific header file for a lpc2138 so
I'm running up against a problem in understanding the CLOS way of handling file
When using autotools (with a config.h file) for both a library, and a software
The way I've always organized my C source was to put struct, macro and
I am creating my own implementation of XUL in C++ using the Windows API.
I am using both the JUCE Library and a number of Boost headers in
I am currently working on a big project and maintaining all those include guards

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.