Why Do We Need Smaller Data Types in C

There are at least two types of integers (short or long) and two types of decimals (float or double) in most Clanguage compilers. We should write all the programs using longs and doubles without ever needing shorts or floats. What do you think was the idea of adding these two additional (smaller) types?

Solution Summary

There are at least two types of integers (short or long) and two types of decimals (float or double) in most C language compilers. We should write all the programs using longs and doubles without ever needing shorts or floats. The following solution discusses why we would ever need these two additional (smaller) types.
I have compiled a comprehensive response, based on my on experience and discussion with other programmers. I am confident you will find the discussion helpful.

$2.19

Purchase Solution

$2.19

Solution provided by:

Education

BSc (Hons), Unversity of Dhaka

MSc , University of Dhaka

PhD, University of Melbourne

Recent Feedback

"thank you for the help"

"The explanations were wonderful. It helps me to break the problem up into sections. When I do that it makes more sense to me. It helps me to focus on one section at a time in order to understand it better. Thank you for all your help. I am, and will continue to write and re-write tutorials until it really make sense. I think, for me, that is the only way that this will make sense; repetition."

"I do have one question. What is up with the four t's(tttt) and three t's(ttt" in the for loops for the array. I have never seen that before. I have seen the \t. Also, I am wondering about the use of the number 8 used behind the $% in these loops as well. I've seen 14 used, but not 8. Just curious."

"Thank you for the explanation of the problem in words and then your example of it. I learn better when I can read and see the outcome. Thanks again! I am going to finish the array to display the banking record. Can I ask you for help if I need it?"