C++ how to get time/date a file last modified? [duplicate]

  c++, file-handling, raspberry-pi

I have a C++ program running on a Raspberry Pi (Linux). Id like to use it to periodically check if a text file (filename.txt) has been modified. Would be looking to read the time and date of the last modified and then periodically check if this has changed.

Ive searched far and wide and can’t find a simple way of doing this. Any ideas?

Source: Windows Questions C++