Search:

Type: Posts; User: Click_here

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    2,139

    There is nothing wrong with your understanding...

    There is nothing wrong with your understanding with heap memory (or at least, I don't think there is) - Your confusion seems to be with the fact that when the function goes finishes, the variable "p"...
  2. Replies
    9
    Views
    2,139

    I think what you are wanting to do is something...

    I think what you are wanting to do is something like this:



    void function(int **p)
    {
    int*y=malloc(4);
    *p=y;

    return;
Results 1 to 2 of 2