Though string is dynamic so it will not have any definite size so when i get s[1] before s[0] how C++ will calculate its offset address.
For example int a[2]
0000:1000 a[0]
0000:1004 a[1]
Program:
#include<iostream>
#include<vector>
using namespace std;
int main()
{
string s[2];
cin>>s[1];
cout<<s[1]<<endl;
cin>>s[0];
cout<<s[0]<<endl;
}
An array of strings is an array of string objects, which are of fixed size and effectively contain pointers elsewhere where the strings actually reside.