remove a non empty directory

C++
1. To recursively delete use

$ rm -r dirname

2.To forcefully delete use

$ rm -rf dirnamerm -rf /path/to/directory/*sudo rm -R [Directory name]
Source

Also in C++: