70,019
社区成员




#include<stdio.h>
struct process{double pcpu;};
struct memory{unsigned long total_mem;};
void getInfo(struct process *pro , struct memory *mem)
{pro->pcpu = 22.0;mem->total_mem = 11;}
void main(){
struct process pro;struct memory mem;
/*void*/ getInfo(&pro , &mem); //你这边加个void 是要闹哪样?声明这个是函数返回类型调用不用带上,去掉就好了
printf("%f\n",pro.pcpu);
printf("%d\n",mem.total_mem);
}