why do we use pointer instead directly acessing the data?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to find out prime number using sieve case?

1626


What is your stream meaning?

585


How do I copy files?

612


Do pointers take up memory?

641


What is the collection of communication lines and routers called?

600






Explain modulus operator. What are the restrictions of a modulus operator?

587


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1646


What is difference between union and structure in c?

564


What is structure packing in c?

593


When should the volatile modifier be used?

667


Explain what are binary trees?

598


Describe the header file and its usage in c programming?

608


Is struct oop?

568


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2697


Why doesn't C support function overloading?

1592