#include <iostream>
#include <algorithm>
int main()
{
char letters[] = "aabbccbccd";
// this will point to the first character of the sequence that is to be
// removed.
char *ptrStart = std::remove(std::begin(letters), std::end(letters), 'b');
*ptrStart = '\0'; // null terminate this
std::cout << "The characters after erasing are: " << letters;
}
ICAgICNpbmNsdWRlIDxpb3N0cmVhbT4KICAgICNpbmNsdWRlIDxhbGdvcml0aG0+CiAgICAKICAgIGludCBtYWluKCkKICAgIHsKICAgICAgICBjaGFyIGxldHRlcnNbXSA9ICJhYWJiY2NiY2NkIjsKICAgICAKICAgICAgICAvLyB0aGlzIHdpbGwgcG9pbnQgdG8gdGhlIGZpcnN0IGNoYXJhY3RlciBvZiB0aGUgc2VxdWVuY2UgdGhhdCBpcyB0byBiZQogICAgICAgIC8vIHJlbW92ZWQuCiAgICAgICAgY2hhciAqcHRyU3RhcnQgPSBzdGQ6OnJlbW92ZShzdGQ6OmJlZ2luKGxldHRlcnMpLCBzdGQ6OmVuZChsZXR0ZXJzKSwgJ2InKTsKICAgIAogICAgICAgICpwdHJTdGFydCA9ICdcMCc7ICAvLyBudWxsIHRlcm1pbmF0ZSB0aGlzCiAgICAgICAgc3RkOjpjb3V0IDw8ICJUaGUgY2hhcmFjdGVycyBhZnRlciBlcmFzaW5nIGFyZTogIiA8PCBsZXR0ZXJzOwogICAgfQoK