why do we use pointer instead directly acessing the data?

Answers were Sorted based on User's Feedback



why do we use pointer instead directly acessing the data?..

Answer / manish

We use the pointer instead of the because of the fast
access of the data as pointer provides direct memory access.

Also, soemtimes passing the ;large structure variable in
the function argument requires large memoy stack but by
passing the pointer to the structure inside the function
will reduce the stack size.

Is This Answer Correct ?    8 Yes 0 No

why do we use pointer instead directly acessing the data?..

Answer / jitendra mishra

As we know pointer shows the address of a particular variable in the memory space.and accessing variable by its name is a bit time consuming because there can have more than one variable of same name but there can not be same address for two different variables.So pointer is more accurate and quick.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are the parts of c program?

0 Answers  


what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }

4 Answers  


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


Difference between for loop and while loop?

1 Answers  


What are identifiers and keywords in c?

0 Answers  


How can you be sure that a program follows the ANSI C standard?

0 Answers   Aspire, Infogain,


How pointers are declared?

0 Answers  


What does %d do?

0 Answers  


What is the use of void pointer and null pointer in c language?

0 Answers  


What is header file in c?

0 Answers  


How can you find the exact size of a data type in c?

0 Answers  


main() { static int ivar=5; printf("%d",ivar--); if(ivar) main(); }

3 Answers   CSC,


Categories