Data Structure ,Pointers : i made a queue in c using pointers ,my code works but i can not understand how the pointer variable rear1 is works ,because every time function called ,rear1 is initialized and same for front ,front store the address of start for first time then after front reinitailize but it still keep start address ,how is it possible.





    enter code here


         #include <stdio.h>
           #include <stdlib.h>

       /* run this program using the console pauser or add your own getch,                                         ("pause") or input loop */
           struct node{
	        int data;
	          struct node *next;
           };
                         enqueue(struct node **start){
             	struct node *front,*rear;
                  	if (*start==NULL){
	        	*start=(struct node *)malloc(sizeof(struct node));
	                  	scanf("%d",&(*start)->data);
	               	(*start)->next=NULL;
	            	printf("%s","hello");
	              	front=(*start);
			         	rear=*start;
		
	                        }
	else
	{
	printf("%d",front->data);
		struct node *temp,*curr;
			
	
	                	curr=(struct node *)malloc(sizeof(struct node));
	               	rear->next=curr;
	            	rear=curr;
	                 	rear->next=NULL;
	                 	scanf("%d",&rear->data);
	
	             }
             	}
	            dequeue(struct node **front){
		struct node *temp;
		temp=(*front);
		(*front)=(*front)->next;
		printf("%d",(temp->data));
		free(temp);
	}

           int main(int argc, char *argv[]) {
	         struct node *start=NULL;
	          enqueue(&start);
	            enqueue(&start);
          enqueue(&start);
             	enqueue(&start);
           	enqueue(&start);
               enqueue(&start);


	dequeue(&start);
	printf("\n");
	dequeue(&start);
	printf("\n");
	dequeue(&start);
		printf("\n");
		dequeue(&start);
	printf("\n");
	dequeue(&start);
	printf("\n");
	dequeue(&start);

	
	return 0;
}
