1.

Where are the strings stored?(a) Stack(b) Heap(c) Both Stack & Heap(d) QueueThis question was addressed to me in a job interview.This intriguing question comes from String Characters topic in section Strings, Streams & Numerics in C++ of C++

Answer»

Right option is (c) Both Stack & Heap

Explanation: Dynamic strings(dynamic LENGTH) are STORED in heap and static string(with FIXED SIZE) are stored in stack.



Discussion

No Comment Found

Related InterviewSolutions