Created
January 27, 2017 19:07
-
-
Save jnbek/11881d5a291bdf50bd0db8bb115b898a to your computer and use it in GitHub Desktop.
Show Install Memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/sysinfo.h> | |
#include <stdio.h> | |
int main() { | |
int days, hours, mins; | |
struct sysinfo sys_info; | |
if(sysinfo(&sys_info) != 0) | |
perror("sysinfo"); | |
// Total and free ram. | |
printf("Total Ram: %ld\n", sys_info.totalram); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment