Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

C++
#If docker not running then we are facing this error issue.
#To over come this issue use the bellow command.
sudo systemctl start docker
# Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
sudo dockerd

Source

Also in C++: