GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 93 of 255    Print  
What are the advantages of using pointers in a program?

  
Total Answers and Comments: 6 Last Update: May 30, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 09, 2005 09:57:43   #1  
vivek kumar gaur        

RE: What are the advantages of using pointers in a program?
The main advantages of using pointers are  
1.) Function cannot return more than one value. But when the same function can modify many pointer variables and function as if it is returning more than one variable.  
2.) In the case of arrays, we can decide the size of th array at runtime by allocating the necessary space.  
 
Coming to the disadvantages of pointers  
1.) If sufficient memory is not available during runtime for the storage of pointers, the program may crash (least possible) 
null

 
Is this answer useful? Yes | No
March 15, 2006 23:21:25   #2  
venkatesh Member Since: November 2005   Contribution: 19    

RE: What are the advantages of using pointers in a pr...

The main advantage of pointer is dynamic memory allocation.


 
Is this answer useful? Yes | No
September 03, 2006 07:28:13   #3  
umesh ram sharma        

RE: What are the advantages of using pointers in a pr...

the main advantage of pointer , you can play with o/s. you can hold the whole memory management. u can chage the content of IVT. u can write directly in the buffer of screen at address oxb8000000. like this many other advantage are their.

form the prog. view yes one can use dynamic memory allocation,as function passing argument, can find the address of any variable etc.


 
Is this answer useful? Yes | No
November 29, 2006 08:26:39   #4  
Manhongo Liberty        

RE: What are the advantages of using pointers in a pr...

Your answers are excellent.


 
Is this answer useful? Yes | No
January 27, 2007 01:18:07   #5  
thathireddy        

RE: What are the advantages of using pointers in a program?
thanks your's answer is wellplease send me examples of pointers like functions using pointers,structures using pointers etc
 
Is this answer useful? Yes | No
May 30, 2008 14:57:25   #6  
gunturi.prabhakar Member Since: May 2008   Contribution: 4    

RE: What are the advantages of using pointers in a program?
The advantages of using pointers are:

1: you can work with the address of the variable
2: you can reference the variables in more different easiest ways....
    e.g  int a[10],*b;
                b=&a;
         if you want to refer a[5] you can refer it as a[5] or *(a+5) or *(5+a)
         this is a simple one....but in large programs it will make a difference.
3. if you want to access a variable quickly or efficiently with out wasting c.p.u time you have only 2 ways..
one is declare it as a register variable...
and other one is declare it with a pointer....
because a c.p.u has less registers in it ( approximately 6 i.e A,B,C,D,E,F,G,H),
when no register are freely available then you CAN DO THAT TASK WITH ONLY POINTERS....
4.by using pointers you can improve the c.p.u's throughput time
(throughput time refers to no of jobs done by the c.p.u in unit amount of time)....
   these are the advantages that can be acquired from pointers.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape