C program to create, initialize and access a pointer variable

In this tutorial, we will write a C program to create, initialize and access a pointer variable. To learn the basics of pointer refer my tutorial: C Pointers Example: Program to create, access and initialize a Pointer In the following program we have declared a character variable ch and character pointer pCh, later we initialized the pointer variable pCh with the […]

C Program to Swap two numbers using Pointers

In this tutorial we will write a C program to swap two numbers using Pointers. We have already covered how to swap two numbers without using pointers. C Example to swap two numbers using pointers #include <stdio.h> // function to swap the two numbers void swap(int *x,int *y) { int t; t = *x; *x = […]

C Program to Print String using Pointer

In this tutorial, we will write a C program to print a String character by character using a pointer variable. To understand this program you should have basic knowledge of the following topics: C Pointers C Array Program to print a String using Pointer In the following program we have declared a char array to […]

C Program to Find the Largest of three numbers using Pointers

In this tutorial, we will write a C program to find the largest of three input numbers using pointers. Program to find largest number using pointers In the following program we have three integers num1, num2 & num3. We have assigned the addresses of these three numbers to three pointers p1, p2 & p3 respectively. Later we performed the comparison on the values stored […]