I used what's below to delete a directory. It only deletes the directory if it's empty. How could I delete a directory and it's contents?

#include <unistd.h>

int main()
    return 0;

What OS are you using?

What OS are you using?

What OS use C:\? :)

The command for deleting folder not empty is:

rmdir /S/Q directory.
The /S will delete directories not empty but asking for Y/N.
The /Q will not ask at all.

Yeah, I don't think those work in a C program though.