C – Pointers and Arrays

After reading this pointers and arrays topic, you will understand its theory and examples also you will able to implement it in C programming.

C pointers and arrays are relating to each other as whenever an array has created, the group of memory location allocated and the pointer is made to point these memory locations. The example below will show how pointer and arrays used in C programming.

 

Example:

Program (1): To demonstrate pointers and arrays.

#include<stdio.h>
#include<conio.h>
void main(void)
{
int i;
int a[]={12,34,2,10};
for(i=0;i<=3;i++)
{
printf("\
}
getch();
}

Output (1)

12
34
2
10

Published by

Electrical Workbook

We provide tutoring in Electrical Engineering.

Leave a Reply

Your email address will not be published. Required fields are marked *