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

C program to demonstrate Pointer to variable:

void p2a(int *);

void main()


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

                int arr[5];

                //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);






743_C program to demonstrate Pointer to variable.png

Posted Date: 9/29/2012 7:00:30 AM | Location : United States

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

Write discussion on C program to demonstrate pointer to variable
Your posts are moderated
Related Questions
Project Description: We are seeking someone to search mp3 link form audio or m3u8 for videos. Skills required are .NET, C Programming, Engineering, C# Programming

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

Write a program to sort an array of strings. Use new and delete operators. Write a program to find the factorial of a number using recursion. If we do not accept the number

C program for bubble sort: void main() { int i,j,k,a[10],n; clrscr(); printf("How many values you want to enter\n"); scanf("%d",&n);  for(i=0;i  {  pri

Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my

Determine the size of an interger data type without using sizeof() function? A: #include int main() { int *i ; int *j = i + 1; cout }

i want a c or c++ code for solving transportation problem using modified distribution method

In this worksheet you are asked to write three classes in C++: Lecture class, Course class and University class. The classes relate to each other in the way that a Course has many