count files recursively linux

C++
find DIR_NAME -type f | wc -l

Source

Also in C++: