I've searched for a while on how to do this without any special library or anything, and it took a while to find something that's working properly.
It's possible to use
/sys/class/power_supply/BAT0/subsystem/BAT0/charge_now
/sys/class/power_supply/BAT0/subsystem/BAT0/charge_full
I was wondering, is there a better way to get the battery status using C/C++ in Ubuntu 18.04?
In case this is never answered.. this is my solution: