how to get list of users in ubuntu

C++
cat /etc/passwdcat /etc/passwd
#check list of users in linux ubuntu
Source

Also in C++: