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.

close

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.

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 was born in 1974, Eskisehir-Turkey, started coding in college and graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. He worked as a research assistant at the same university for more than 10 years. He received his MSc and PhD degrees from the same department at the same university. Since 2012, he is the founder and CEO of Esenja LLC Company. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Learn C++Syntax

What Is A Forced (Default) Copy Assignment Operator In Modern C++

C++C++11C++14C++17C++20Learn C++Syntax

What is Implicitly-declared Copy Assignment Operator In C++?

C++C++11C++14C++17C++20Learn C++Syntax

What is Avoiding Implicit Copy Assignment In C++?

C++C++11C++14C++17C++20Learn C++

Typical Declaration Of A Copy Assignment Operator Without std::swap