I would like to put only 'World' into a string or vector.
Is it possible without a for loop?
Code:int main() { string Data; char buf[] = "Hello World"; for(int i=6; i< 12; i++) { Data[i] = buf[i]; cout << "Data: " << Data[i] << endl; } cout << "Data: " << Data << endl; return 0; }