Results 1 to 6 of 6

Thread: What are the advantages of pointers?

  1. #1
    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.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,010

    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,302

    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.

  4. #4
    Join Date
    Oct 2005
    Posts
    2,394

    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)

  5. #5
    Join Date
    May 2008
    Posts
    2,393

    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.

  6. #6
    Join Date
    Feb 2008
    Posts
    1,856

    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.

Similar Threads

  1. Pointers in C and C++
    By unlimitedtech in forum Guides & Tutorials
    Replies: 4
    Last Post: 04-02-2010, 11:42 AM
  2. Pointers VS Arrays in C++
    By Rum in forum Software Development
    Replies: 5
    Last Post: 18-01-2010, 01:06 PM
  3. Pointer to an array of pointers
    By pushpendra in forum Software Development
    Replies: 3
    Last Post: 29-12-2009, 11:45 AM
  4. Are pointers and arrays equivalent
    By KALINDA in forum Software Development
    Replies: 3
    Last Post: 16-10-2009, 06:41 PM
  5. Arrays and Pointers in C
    By Ivy00 in forum Software Development
    Replies: 1
    Last Post: 10-11-2008, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •