Hello~
I write a code for see memory status.
Here my code
Run this code result is strange.
This is my first linux applications so i need help.
Thanks for any help!!!
I write a code for see memory status.
Here my code
Code:
FILE *Memory;
unsigned long dwMemoryTotalSize;
unsigned long dwMemoryUsedSize;
unsigned long dwMemoryFreeSize;
Memory = fopen ( "/proc/meminfo", "r" );
if ( NULL != Memory )
{
fscanf ( Memory, "%ld %ld %ld", &dwMemoryTotalSize, &dwMemoryUsedSize, &dwMemoryFreeSize );
fclose ( Memory );
printf ( "Total = %ld, Used = %ld, Free = %ld\r\n", dwMemoryTotalSize, dwMemoryUsedSize, dwMemoryFreeSize );
}
Run this code result is strange.
This is my first linux applications so i need help.
Thanks for any help!!!