Hi Sheila,
Here's some piece of code that may be of help to you.
Say you have two programs pgm1 and pgm2:
ps -efl|grep pgm1 |sed 's/ */ /g'|cut -f11 -d' '|pg >pgm1_siz
ps -efl|grep pgm2 |sed 's/ */ /g'|cut -f11 -d' '|pg > pgm2_siz
diff siz_pgm1 siz_pgm2 > diff_pgm12_siz
Note:The eleventh field of "ps -efl" is the memory size of your process
You can do the above steps using system() or popen() from your C++ code.
regards,
VGG