get coordinates of the cursor ubuntu

C++
===for ubuntu===
type following command on terminal
xdotool getmouselocation
Source

Also in C++: