Pointers

Where is the strongest use of pointers????

Page 1 of 1

3 Replies - 514 Views - Last Post: 08 October 2009 - 11:09 AM Rate Topic: -----

#1 Avadhesh_gadia  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 25-September 09

Pointers

Post icon  Posted 07 October 2009 - 10:24 PM

What n where is the strongest use of pointers???????
Is This A Good Question/Topic? 0
  • +

Replies To: Pointers

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4333
  • View blog
  • Posts: 12,128
  • Joined: 18-April 07

Re: Pointers

Posted 07 October 2009 - 10:31 PM

Anywhere you are referring to objects. The whole idea of pointers is to point to other objects or variables. Typically if you define a class (which can take up a lot of memory) you are going to use a pointer to it rather than moving that object around in memory itself which is inefficient and time consuming. So if you run into a program which has classes you are typically going to find pointers referring to those class instances.

For this reason data structures like linked lists pointing to nodes will have pointers, when you are passing arrays in and out of functions, or when you are trying to assign the value of one pointer to another to change what that pointer points to.

There are plenty of examples on the net which show you how to use and when to use pointers. Look at example programs that use objects to see pointers in action. :)
Was This Post Helpful? 0
  • +
  • -

#3 militiaman  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 28-August 09

Re: Pointers

Posted 07 October 2009 - 10:31 PM

View PostAvadhesh_gadia, on 7 Oct, 2009 - 09:24 PM, said:

What n where is the strongest use of pointers???????


Pointers are extremely versatile and there isn't a "strongest use". Also, why so many ?
Was This Post Helpful? 0
  • +
  • -

#4 Avadhesh_gadia  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 25-September 09

Re: Pointers

Posted 08 October 2009 - 11:09 AM

View PostMartyr2, on 7 Oct, 2009 - 09:31 PM, said:

Anywhere you are referring to objects. The whole idea of pointers is to point to other objects or variables. Typically if you define a class (which can take up a lot of memory) you are going to use a pointer to it rather than moving that object around in memory itself which is inefficient and time consuming. So if you run into a program which has classes you are typically going to find pointers referring to those class instances.

For this reason data structures like linked lists pointing to nodes will have pointers, when you are passing arrays in and out of functions, or when you are trying to assign the value of one pointer to another to change what that pointer points to.

There are plenty of examples on the net which show you how to use and when to use pointers. Look at example programs that use objects to see pointers in action. :)

Thanks a lot
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1