- while (stat[i].pid != getpid()) i++;
- // Display total memory size
- double mem = stat[i].proc_resident/1024/1024; // in Mb
+ while (stat->pid != getpid() && i < entries)
+ {
+ ++i;
+ ++stat;
+ }
+
+ // Display total memory size
+ double mem = stat->proc_resident/1000/1000; // in MB