How memory get consumed in strings if we declare a string.
Regarding cpp-strings STL
Hi, Raushan, string in STL is a class. Memory consumed for strings is 24 bytes.
You can check it using:
#include < iostream >
#include < string >
using namespace std ;
int main() {
string s = “” ;
cout << sizeof(s) << endl ;
}
Hope this helps 
Hey Raushan,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.
Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.