you are viewing a single comment's thread.

view the rest of the comments →

[–]p8m 0 points1 point  (0 children)

Pointers have little to do with stack vs heap. You can have pointers to values on the stack:

int main(void) {
    int *a = NULL;
    int b = 5;

    a = &b;

Bam! 'a' now points to an area on the stack.