I just wrote the following C++ function to programatically determine how much RAM a system has installed. It works, but it seems to me that there should be a simpler way to
Remember /proc/meminfo is just a file. Open the file, read the first line, close the file. Voilá!