Every process has 4 segments, data, text, stack, and heap.
Data segment is for global, static data member, as well as static variable in a function. So, in your example, a, pl, and d are in data segment.
Text segment is for code, all the compile generated (corresponding to your source code) code stored in this are.
Stack is for local variables as well as the activation record of function call. So, c and p2 of your example are in this area. Activation recrod includes at least returning address, return value, and parameter. So, the parameter b of function f is in this area.
Heap is for dynamically allocated memory (many OS put the shared library here as well). In your example, you did not show any code that dynamically allocate memory for pl and p2. If you do, the memory pointer by pl and p2 will be in heap, for example:
pl = new int;
p2 = (int*)malloc(sizeof(int));
It is important to remember that pl and p2 themself are not in heap but the memory they point to might.