76
GB
What is the output: try{string s=string(size_t(-1),'x');}catch(bad_alloc&){cout<<'M';}catch(length_error&){cout<<'L';}
IN
आउटपुट क्या है: Try{string s=string(size_t(-1),'x');}catch( Bad_alloc&){cout
A
L
एल
B
M
एम
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
size_t(-1) is UINT_MAX — too large; string throws length_error or bad_alloc. Most likely bad_alloc. Output: M.
व्याख्या (हिन्दी)
size_t(-1) UINT_MAX है - बहुत बड़ा; स्ट्रिंग length_error या Bad_alloc फेंकती है। सबसे अधिक संभावना ख़राब_आवंटन। आउटपुट: एम.