Leanne
Leanne

Reputation: 687

How to print out memory address of UNIX application's memory using C?

Does anyone know how to print out memory addresses of UNIX application's memory using C?

I need to print out those information of addresses when I run my code, for instance 'the number of pages of physical memory'

The output i'm looking for this example is something like...

Number of pages:
          384285

Thank you

Upvotes: 0

Views: 538

Answers (1)

Joshua
Joshua

Reputation: 43278

char buf[40];
sprintf(buf, "exec cat /proc/%d/status", getpid());
system(buf);

Upvotes: 1

Related Questions