C++C++11C++14C++17C++20Introduction to C++Learn C++

What Are Function Macros For Integer Constants?

What Are Function Macros For Integer Constants

In C++ coding, there are function macros for the fixed-width integer type that expands to an integer constant expression having the value specified by its argument. Their type is the promoted type of std::int_least8_t, std::int_least16_t, std::int_least32_t, and std::int_least64_t and unsigned versions of these types respectively. In this post, we explain these function macros for integer constants in Modern C++.

What are function macros for signed integer constants?

Here are the function macros for the fixed-width integer type that expands to an integer constant expression having the value specified by its argument. Their type is the promoted type of std::int_least8_tstd::int_least16_tstd::int_least32_t and std::int_least64_t respectively,

Fixed Width Integer TypesDescription
INT8_Cexpands to an integer constant whose type is std::int_least8_t
INT16_Cexpands to an integer constant whose type is std::int_least16_t
INT32_Cexpands to an integer constant whose type is std::int_least32_t
INT64_Cexpands to an integer constant whose type is std::int_least64_t

What are function macros for unsigned integer constants?

Here are the function macros for the fixed-width integer type that expands to an integer constant expression having the value specified by its argument. Their type is the promoted type of std::uint_least8_tstd::uint_least16_tstd::uint_least32_t and std::uint_least64_t respectively.

Fixed Width Integer TypesDescription
UINT8_Cexpands to an unsigned integer constant whose type is std::uint_least8_t
UINT16_Cexpands to an unsigned integer constant whose type is std::uint_least16_t
UINT32_Cexpands to an unsigned integer constant whose type is std::uint_least32_t
UINT64_Cexpands to an unsigned integer constant whose type is std::uint_least64_t

What are other function macros for integer constants?

INTMAX_C function macro, expands to an integer constant whose type is std::intmax_t,

Fixed Width Integer TypesDescription
INTMAX_Cmin. value of 8 bits signed integer type

UINTMAX_C function macro, expands to an integer constant whose type is std::ıintmax_t,

Fixed Width Integer TypesDescription
UINTMAX_Cmin. value of 8 bits signed integer type

If you are looking more about Integer Constants there are more details about them, https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Integer_Constants
If you are looking more about Declared Constants, you can follow this link: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Declared_Constants

Is there a simple C++ example of using function macros for integer constants?

Here is a very simple C++ example of how you can use function macros for integer constants.

Is there a full C++ example of how to use function macros for integer constants?

Here is a full C++ example of how to use function macros for integer constants.

What Are Function Macros For Integer Constants The C++ Builder Logo

C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, MacOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for cross-platform UIs.

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

C++C++11C++14C++17Introduction to C++Learn C++Syntax

Learn How To Use Types Of Destructors In C++?

C++C++11C++14Learn C++Syntax

How To Convert u32string To A wstring In C++

C++C++11C++14C++17C++20Introduction to C++Learn C++

How To Learn The Move Constructors In Modern C++?