You have declare delspace to be a char* (an string array) but nevertheless you apply to it a member of std::string, i.e. erase()?
I think you have mixed up these two containers.
String in c are defined like arrays ending with \0.
In c++ on the other hand std::string is preferred.
You cannot normally delete an element of an array but instead you can do this:
either push all elements one position to the left and don't use the last position OR create a new array with the number of elements you want.
On std::string there are function members like erase() which you can use to your accommodation. Using these you can erase an element of your string. see next page for example over this option: http://www.cplusplus.com/reference/string/string/erase/