delete all folders except one linux

C++
find * -maxdepth 0 -name 'b' -prune -o -exec rm -rf '{}' ';'
Source

Also in C++: