Smart pointers are objects in C++ that simulate pointers but provide automatic memory management. Examples include std::unique_ptr, std::shared_ptr, and std::weak_ptr in C++11 with candy clicker .
Different types of Pointers in C Language: (1) Void Pointer: A void pointer is a pointer that has no associated data type with it. A void pointer can hold address of any type and can be typcasted to any type. (2) Dangling Pointer: If any pointer is pointing to the memory address of any variable but after some time that variable has deleted from the memory location while pointer is still pointing such memory location then such pointer is called as Dangling pointer. (3) NULL Pointer: Literal meaning of NULL pointer is a pointer which is pointing to nothing. (4) Near pointer :- A pointer variable which can handle only one segment of 1MB data. It is called near pointer (5) Far pointer :- Which pointer variable can handle any segment of 1MB data, it is called far pointer. (6) Wild Pointer or Bad pointer : Unintialized pointer variable or which pointer not initialized with any variable address. It is called wild pointer
You need to distinguish the variable and the pointer to the variable. When we declare: int x; int *p; x = 1; // direct assignment to x p = &x; // the value of p is the address-of x *p = 42; // assigns a value to the variable pointed to by p // (in this case, indirect assignment to x) The variable x has type int; i.e. it is a variable to which we can assign an int directly, or a pointer-to-int can refer to its location. p is a different variable, with type "pointer to int". We can set p to the location of x (&x); then we can store 42 in "the variable pointed to by p".
Yes ,we can define Type of pointer. A pointer holds the address of another variable that is stored in the memory. Different types of pointers are
1)Null pointer
2)dangling pointer
3)wild pointer
4)generic pointer
5)Huge pointer
6)Far pointer
7)Near pointer
8)Complex pointer
A pointer is basically the address of the variables. It stores the value (numeric value) which is the address to the particular variable.There are various type of pointers in C programming . Few of them are listed below. NULL POINTER- as the name suggests , the pointer points towards zero (nothing) value. It is used to initialize pointer variable when it is not assigned with proper memory. DANGLING POINTER- if the variable is deleted but the pointer still points towards its address is known as dangling pointer. WILD POINTER- No initialization to a pointer give wild pointer. GENERIC POINTER- the pointer with type void is called as Generic pointer. NEAR POINTER-pointers which can only point small segments are called near pointer. FAR POINTER- pointers which can point large segments are called far pointer. HUGE POINTER- pointers which can point whole memory are called huge pointer. COMPLEX POINTERS.