Tuesday, 16 January 2018

Learn C language Part 37 Arrays of Pointers in C language





#include <stdio.h>

#include <conio.h>



main()

{



int x[3]{100,200,300};

int i=0;

int *ptr[3];



for(i=0;i<3;i++)

{

ptr[i]=&x[i];

}







printf("\nWithout pointers\n...............................\n");



for(i=0;i<3;i++)

{



printf("values at index %d = x[%d] \n",i,x[i]);



}



printf("\nWith pointers\n...............................\n");



for(i=0;i<3;i++)

{



printf("values at index %d = x[%d] is saved at @ %d, address of array is %d  \n",i,*ptr[i],&ptr[i],ptr[i]);



}









}

No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...