C program to demonstrate pointer to array, C/C++ Programming

C program to demonstrate Pointer to array:

void p2a(int *);

void main()


                int x=10, *a,**b;

                int arr[5];

                a=&x;//pointer to variable



                printf("\nvalue of x=%d",x);

                printf("\nvalue of x using pointer(a) =%d",*a);

                printf("\nvalue of x using pointer to pointer(b) =%d\n",**b);

                printf("\naddress of x=%u",&x);

                printf("\naddress of x=%u",a);

                printf("\naddress of x=%u",*b);

                printf("\naddress of a=%u",&a);

                printf("\naddress of a=%u",b);

                printf("\naddress of b=%u",&b);

                //pointer to array

                printf("\n \n\n<<>>\n");

                for (int i=0; i<5; i++)

                {printf("\nEnter %d th element of array\t",i);







void p2a(int *y)


                printf("\n printing array element using array\n");

                for (int i=0;i<5;i++)


                                printf("\n %d",*y);






Posted Date: 9/29/2012 7:06:44 AM | Location : United States

Related Discussions:- C program to demonstrate pointer to array, Assignment Help, Ask Question on C program to demonstrate pointer to array, Get Answer, Expert's Help, C program to demonstrate pointer to array Discussions

Write discussion on C program to demonstrate pointer to array
Your posts are moderated
Related Questions
#padovan string in java   program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class PadovanStrin

Floating  literal They can be written in common decimal as well as scientific notation (floating point representation). By default it is of type double. F, L is applied only to

A: No. If they're utilized properly, they increase encapsulation. You frequently require splitting a class in half while the two halves will have distinct numbers of instances o

# include stdio.h> # include conio.h> # include math.h>   void main () { int a=1,sqr=0,cube=0; clrscr (); while (a { sqr=pow(a,2); cube=pow(a,3);

Implementing Operator Functions The general format of the Operator function is: return_type operator op ( argument list );   Where op is the symbol for the operator be

I am seeking a developer to create a mobile game for me. I want an endless runner game with simple controls. The game needs to be a 3D game in a 2D view. The graphics and animation

#queWrite a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points c

Need Cron Job Parsing JSON from API, Inserting in to DB Project Description: The Project is to prepare a Cron Job with an adjustable interval in seconds and milli seconds. Cr

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

Both malloc & new functions are utilized for dynamic memory allocations & the basic difference is: malloc need a special "typecasting" while it allocates memory for eg. if the poin