So I am very new to C++ and Linux and i need to find the time of the last boot from a c++ file. I have been using /proc files for the other info. I am not looking for up time.
I was trying to find a way to execute the “last reboot” command from my .cpp file but i cant figure this out. Is this possible, or is there a way to find the current time so i can subtract up time form the current?
Very lost…
This is homework by the way, but i have completed every other section and am just tied up on this one small part.
Also i have goggled for hours and just cant find a way… Am i misinterpreting something and its more simple then I am making it?
Just need the time of the last system boot
Thanks!
Figured it out with the /var/log/syslog not perfect since it will only work for 5 weeks but i think its sufficient for my assignment thanks all!