how to check how many files are in a folder linux

C++
ls | wc -lls -1q log* | wc -l$ ls | wc -l
Source

Also in C++: