Why are so many data types provided in C++.

Q14. Why are so many data types provided in C++?

Ans. The reason for providing so many data types is to allow programmer to take advantage of hardware characteristics. Machines are significantly different in their memory requirements, memory access times (time taken to read memory), and computation speeds. Suppose, a program that earlier was working with 2-byte int efficiently, on shifting to a machine that provides 4-byte int and 2-byte short can easily work with short of the new machine thereby not increasing the memory requirements of the program.

Leave a Reply

Your email address will not be published. Required fields are marked *

83 Views
%d bloggers like this: