C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - True / False Questions (Q.No. 6)
6.
Size of short integer and long integer would vary from one platform to another.
Answer: Option
Explanation:
True, Depending on the operating system/compiler/system architecture you are working on, the range of data types can vary.
Discussion:
7 comments Page 1 of 1.
Vikas Sharma said:
1 decade ago
The range of short and the long data type is compiler independent. It is the range of int which depends on the compiler.
If some one can provide further clarifications on the credibility of the answer than please come up.
If some one can provide further clarifications on the credibility of the answer than please come up.
Teju said:
1 decade ago
Yes, it depends on the compiler 16-bit compiler like turbo c/c++ or 32 bit compiler like gcc or visual studio.
Vishal Naik said:
1 decade ago
Agree with @Vikas. Sizeof short int is always 2 bytes and long int is 4 bytes irrespective of the compiler.
Amr samy said:
1 decade ago
Agree with @Vikas, As Short and Long keywords are compiler independent so their length is fixed for all platforms.
Short : 2 Bytes.
Long : 4 Bytes.
Short : 2 Bytes.
Long : 4 Bytes.
Murali R said:
8 years ago
Yes, I agree with @Vikas, size of short int and long int is independent with compiler.
Jatin said:
8 years ago
Yes I agree with @Vikas Sharma.
Short and long is compiler independent The default treatment by the compiler may be somewhere long and somewhere short.
Short and long is compiler independent The default treatment by the compiler may be somewhere long and somewhere short.
Rahul said:
7 years ago
How would change the value of the long and short int, there size is fix?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers