Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What are the advantages of pointers?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-02-2010
Member
 
Join Date: Dec 2009
Posts: 32
What are the advantages of pointers?
  

Hello friend,

I am beginner to the C programming. The 'Pointers' concept of C programming seem quit tough to understand. I am not able to understand the what are the advantage of using pointers in any program. Is it any special use of pointers?. If you know any advantage of using 'Pointer', then please let me know that. I will greatly appreciate you any help.

Reply With Quote
  #2  
Old 09-02-2010
Member
 
Join Date: Apr 2008
Posts: 1,999
Re: What are the advantages of pointers?

The basic advantages of using pointer is that, it enables the use of dynamic memory allocation. A pointer is a variable containing the address of another variable of a type. The concept of pointer is often afraid because this is a technical programming very powerful for defining dynamic structures, that is to say that evolves over time (as opposed to tables such which are static data structures whose size is fixed to the definition.
Reply With Quote
  #3  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,289
Re: What are the advantages of pointers?

Different types of smart pointers can implement various strategies within the same program. In standard C++ has no mechanism for garbage collector (garbage collector), which a prior that could make it more complex to use that language to have. But in fact, with smart pointers, it has a different mechanism to solve the same problem of resource management. With the pointer the resource management task becomes relatively transparent.
Reply With Quote
  #4  
Old 09-02-2010
Member
 
Join Date: Oct 2005
Posts: 2,388
Re: What are the advantages of pointers?

Advantages of using pointers:
  • Pointer can handle simple data that can be important (instead of passing a function to a very large (in size))
  • The tables can store a fixed number of elements of the same type. By storing pointers in boxes in a table, it will be possible to store elements of different sizes, and even add elements Table in use (the concept of dynamic array is very closely linked to the pointer)
Reply With Quote
  #5  
Old 09-02-2010
Member
 
Join Date: May 2008
Posts: 2,379
Re: What are the advantages of pointers?

As in C, the C + + allows to use pointers to manipulate data, but it also introduces the concept of reference handy to allow editing of data passed in a function. A pointer is a variable that must be defined by specifying the type of variable pointed. With the symbol '*' the compiler knows it is a variable of type pointer and not an ordinary variable, again, given that you specify (obligatory) the variable type, the compiler knows how many blocks after block located at address.
Reply With Quote
  #6  
Old 09-02-2010
Member
 
Join Date: Feb 2008
Posts: 1,844
Re: What are the advantages of pointers?

With Pointers we get the functionality for the implementation of the complex data structures.After declaring a pointer it must be initialize. This approach is very important because when you declare a pointer, it contains what the box, where it is stored before contained, that is to say, any number. Otherwise, if you do not initialize your pointer, it may point to a hazardous area of your memory, which may be a piece of your program or your operating system.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What are the advantages of pointers?"
Thread Thread Starter Forum Replies Last Post
Pointers in C and C++ unlimitedtech Guides & Tutorials 4 04-02-2010 11:42 AM
Pointers VS Arrays in C++ Rum Software Development 5 18-01-2010 01:06 PM
Pointer to an array of pointers pushpendra Software Development 3 29-12-2009 11:45 AM
Are pointers and arrays equivalent KALINDA Software Development 3 16-10-2009 06:41 PM
Arrays and Pointers in C Ivy00 Software Development 1 10-11-2008 04:28 PM


All times are GMT +5.5. The time now is 02:29 AM.