For instance, real number in Java takes 8 byte while it only takes 4 byte in C++. Similarly, for character, Java takes 2 bytes, but C++ takes only 1 byte. Why are they of different size?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you are stating isn’t true. C and C++ don’t have any fixed sized types (apart from those specified in
stdint.h).And if you didn’t get you answer from that statement, here is an explicit one:
“There is a difference, because Java contains fixed sized data types, while all basic data types in C and C++ depend on the actual platform (machine architecture + operating system) the program is compiled for.”