3 Fix typo
source | link

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependent on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when createingcreating an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependent on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when createing an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependent on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when creating an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

2 Fixed typo.
source | link

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependantdependent on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when createing an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependant on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when createing an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependent on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when createing an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

1
source | link

As your question is tagged C++, I will answer your question for that language.

In C++ there is a distinction between pointers and references, therefore there are two scenarios where pointers (or smart pointers) are necessary to facilitate certain behaviours. They can be used in other circumstances, however you ask how "best to use them", and in all other circumstances there are better alternatives.

1. Polymorphism

A base class pointer allows you to call a virtual method that is dependant on the type of object that pointer points to.

2. Creating persistent objects

Pointers are necessary when createing an object dynamically (on the heap instead of the stack). This is necessary when you want that objects lifetime to be longer than the scope in which it is created.

In terms of "good projects or problems to resolve", as others have said here already, any non-trivial project will make use of pointers.

    Post Made Community Wiki by dangerousdave