Second, there is a area where we do care about memory footprint: embedded systems == IoT. Furthermore, this is an area where C and C++ are by far the most used languages.
Last, and by far the most important: the results of your code in the article depend on the compiler and target CPU. This is a critical point in C and C++. See for instance the section Data models and the first chart on this page. The outputs you get are typical on a computer nowadays. But on embedded systems you will get different results.
It is important to tell people that types have a memory footprint. But it is more important to tell them that it is also complicated.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello,
I think you are missing 3 points here.
First, C++ offers an awesome template class to get the maximum value that a type can held:
std::numeric_limits
. Example:Second, there is a area where we do care about memory footprint: embedded systems == IoT. Furthermore, this is an area where C and C++ are by far the most used languages.
Last, and by far the most important: the results of your code in the article depend on the compiler and target CPU. This is a critical point in C and C++. See for instance the section Data models and the first chart on this page. The outputs you get are typical on a computer nowadays. But on embedded systems you will get different results.
It is important to tell people that types have a memory footprint. But it is more important to tell them that it is also complicated.