What are the leading players in the industry in games? compression? embedded systems? data? [closed]

0

I learned pointers and I know that it works with memory addresses, I have used it very little, I would like to know if it has any large-scale use?

    
asked by jc_delgado 23.02.2017 в 06:36
source

1 answer

3

The pointers are generally used for two reasons:

  • share information
  • polymorphism

The first case is simple to see. If you have an object that is going to be accessed from multiple modules, it is normal to work with pointers to avoid the systematic duplication and duplication of the object (there is only one copy of the object and pointers are created pointing to that element).

The second is a bit more complex but basically what it allows is to store objects of different types in a generic array, treating these objects in a generic way regardless of their specific type. For this mechanism to work, it is necessary that all the objects to be stored in the list have a common inheritance, be it a base class or an interface.

Use on a large scale? Starting from the basis that multiple objects in the standard library use pointers ( std::string , std::map , std::vector , std::list , std::shared_ptr , ...) and that many of these objects can be found in the almost all commercial programs programmed with C ++ you can get an idea that the use of pointers is completely widespread.

The important thing is not whether a program uses pointers or not (that surely use them), the important thing is to learn to distinguish situations in which the use of pointers is recommended from those in which its use is totally inadvisable.

    
answered by 23.02.2017 в 08:47