Home » C Programming » Tutorial »
Poniters in C Programming
Pointers are special type of variable which are used in storing address of some other varialble. In C programming it is allowed to create pointer to any data type. Size of pointer varies from compiler to compiler.
Pointer to Predefined Data Type
#include int main() { int a = 10; int * ptr = &a; printf("%d",*ptr); return 0; }
In above program, ptr is int type pointer and it is holding address of int type variable a. If we want to get the value of variable pointed by pointer then we use * before the pointer variable.
#include int main() { int a = 10; int * ptr = &a; *ptr++; printf("%d",*ptr); return 0; }
We can increate the variable value by using pointer. Either we do a++ or *ptr++; both are doing same operations.
C Tutorial
- History of C Language
- The First Program in C
- Compilation & Execution
- Compile C on Dev-C++
- Compile C on GCC Linux
- Variable & Data types
- Comments
- Storage Classes
- Conidtional Statements
- Switch Cases
- Loops (for, while, do-while)
- Arrays
- Pointers
- Function Pointer
- Strings & Library func
- Formated I/O
- Structure
- Enum
- Union
- File I/O
- Memory Management
- Error Handling
- Type Casting