how to read temperature in linux

C++
cat /sys/class/thermal/thermal_zone0/temp

thermal_zone0 can be different
Source

Also in C++: