Impetus Technologies interview question

How to allocate memory in String?