C语言实现获取内存信息并输出的实例
实现实例代码:
headfile.h
#include
#include
#include
#define TRUE 1
#define FALSE 0
#define MAX 10000
typedef int KeyType;
typedef int OtherType;
typedef struct
{
KeyType key;
OtherType other_data;
}RecordType;
seek.cpp
#include "stdafx.h"
#include "headfile.h"
#include "windows.h"
#include "conio.h "
#include"WinBase.h"
#include "Psapi.h"
#pragma once
#pragma message("Psapi.h --> Linking with Psapi.lib")
#pragma comment(lib,"Psapi.lib")
int Data[MAX]={0};
void produceData(int a[],int length) //给数组生成数据,用于随即查找
{
time_t t;
srand(time(&t));
for (int i=0;i