Chinaunix首页 | 论坛 | 博客
  • 博客访问: 557263
  • 博文数量: 104
  • 博客积分: 4131
  • 博客等级: 上校
  • 技术积分: 1137
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-31 15:05
文章分类

全部博文(104)

文章存档

2011年(13)

2010年(23)

2009年(68)

我的朋友

分类: WINDOWS

2009-12-12 13:09:03

#include
#include
#define DIV 1048576
 
void main(int argc, char *argv[])
{
  MEMORYSTATUS stat;
  GlobalMemoryStatus (&stat);
  printf ("The MemoryStatus structure is %ld bytes long.\n",
          stat.dwLength);
  printf ("It should be %d.\n", sizeof (stat));
  printf ("%ld percent of memory is in use.\n",
          stat.dwMemoryLoad);
  printf ("There are %ld total M of physical memory.\n",
          stat.dwTotalPhys/DIV);
  printf ("There are %ld free M of physical memory.\n",
          stat.dwAvailPhys/DIV);
  printf ("There are %ld total M of paging file.\n",
          stat.dwTotalPageFile/DIV);
  printf ("There are %ld free M of paging file.\n",
          stat.dwAvailPageFile/DIV);
  printf ("There are %ld total M of virtual memory.\n",
          stat.dwTotalVirtual/DIV);
  printf ("There are %ld free M of virtual memory.\n",
          stat.dwAvailVirtual/DIV);
}
阅读(1582) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~