Skip to main content

Posts

Showing posts with the label Pointer uses in Array

Pointer and Array in C Program #DOTC_Mdb

Pointer and Array in C Program.   Hello Everyone, Today we will discuss about Pointer and Array in C Program. I recommend you to refer my below blogs before starting this topic. https://dheeraj60.blogspot.com/2020/06/array-and-its-beneifts-in-c-program.html https://dheeraj60.blogspot.com/2020/06/multi-dimensional-array2d-and-3d-in-c.html https://dheeraj60.blogspot.com/2020/06/basic-concept-of-pointer-in-c-and-its.html https://dheeraj60.blogspot.com/2020/06/pointer-to-pointer-in-c-program-dotcmdb.html   As we already know An array is a block of sequential data and Pointer used to get the variable address. So understand the below Program where we print the address of Array elements by using pointer.   #include<stdio.h> #include<stdlib.h>   int main( ) {    int *p;      int print[4] = { 10, 11, 12, 13} ;      p = &print[0];    for ( int i = 0 ; i<4 ; i++ )    {       printf("print[%d]: value is %d and address is %p\n", i, *p, p);       p+