Question: ```
struct node
{
    int data;
    node *next;
} * save;

```

Can anyone explain what's the difference between below declarations, does stack & heap-based memory allocation is the only difference between them or any other?
Can we call both of them as object pointers?

```
node *temp;

```

and

```
node *tmp = new node;

```

Answer: 
The new operator denotes a request for memory allocation on the Free Store. If sufficient memory is available, new operator initializes the memory and returns the address of the newly allocated and initialized memory to the pointer variable.

Syntax to use new operator: To allocate memory of any data type, the syntax is:

```
pointer-variable = new data-type;

```

Here, pointer-variable is the pointer of type data-type. Data-type could be any built-in data type including array or any user defined data types including structure and class.
Example:

```
// Pointer initialized with NULL
// Then request memory for the variable
int *p = NULL; 
p = new int;   

            OR

// Combine declaration of pointer 
// and their assignment
int *p = new int;

```
In your example `node* temp` creates an object of type `node*` with *automatic storage* (see [storage duration](https://en.cppreference.com/w/cpp/language/storage_duration)).
In the first line this object is uninitialised and in the second you initialise it with a pointer to an object of type `node` that lives in *dynamic storage*.

So in the first example no object of type `node` actually exists. You have only created a pointer that may later refer to such an object.
In any case, when the lifetime of the object named `temp` ends (i.e. when the the scope ends) only the pointer object will be destroyed, never the object that the pointer may point to.

Note that you cannot access members of an object that doesn't exist, so `temp->data` will exhibit [undefined behaviour](https://en.cppreference.com/w/cpp/language/ub) if `temp` does not point to an object of type `node`.