why do we use pointer instead directly acessing the data?
Answers were Sorted based on User's Feedback
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 |
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 |
What are the parts of c program?
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; } }
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
Difference between for loop and while loop?
What are identifiers and keywords in c?
How can you be sure that a program follows the ANSI C standard?
How pointers are declared?
What does %d do?
What is the use of void pointer and null pointer in c language?
What is header file in c?
How can you find the exact size of a data type in c?
main() { static int ivar=5; printf("%d",ivar--); if(ivar) main(); }