|
#include<stdio.h>
#include<stdlib.h>
int main(){
int a=100,*b;
b=&a;
printf("Address of value:%d",b);
printf("\nenterd value is :%d",*b);
return 0;
} |
Null pointer
the null pointer should not contain any values its only contains empty elements. when you're going to apply this null pointer means, while you are writing the code based on real-life examples or data structure examples. that time you will use this code. Say for example, just think about the linked list it should contain only two parts one is the linked part which is used for linking our node to another node, another one is the data part which contains our values. hereafter linking all the nodes at the last node shouldn't contain any linked part. once we traverse the linked list from starting to the end , at the first part it's having the elements and another one also having the data part. at the last end, we don't have any data to giving the linker so that, on that time our pointer will give null values. which means its don't have no data after the last node.

No comments:
Post a Comment