In Python and C#, we need to place a negative index to get last value.
In C++, I don't know how to do it. I tried the same way to do it but it didn't work out.
Example
string str = "get last space "
cout << str[-1];
In this example, I should get null
value because there's a tailing space in the string. How can I do this?