In C programming, the location of a pointer depends on its declaration context. A pointer declared within a function is stored on the stack, while the memory it points to can be on the heap if dynamically allocated using malloc. This means that when a pointer is created and memory is allocated for it, the pointer itself resides on the stack, but it references a block of memory on the heap. Conversely, if a pointer is assigned to point to a variable within the same function, both the pointer and the variable are on the stack. The distinction is important: pointers can be global, static, or local, affecting their storage location. Overall, unless a pointer is declared globally, it will be on the stack.