It's easy in C++ if you use a
instead of a plain array.
// this isn't a complete program you could compile, just a code snippet
// let's pretend myvec has been filled with suitable values, to remove any
myvec.erase(std::remove(myvec.begin(), myvec.end(), 12), myvec.end);