Pointers
-
Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.
-
Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.
Its no use explaning about pointers like this in the forum, what you should really do is get a book on pointers and understand the concept and different things related to that like referencing and how it is used with function arguments etc.. sure i can anwer this question but i bet its going to only solve one question from 100s regarding pointers. so no point do it.
I have lost more blood shaving than on the battlefield - Adolf Hitler
-
Hi I would like to know why do we realy need pointers is it posible to write a program without the use of pointers. Explain the free store and the heap MyAp *YourAp = new MyAp; is this accessing the free store An example would be nice thanks Kind of a beginner. thanks in advance.
hi man, in fact, we uns pointers for many reasons. First, in C++, the existence of the pointers comes from the compatibility with the C, in which references don't exist. We also use pointers instead of value copies in function calls because it become heavy and "memory hungry" if we transfer some big data structures... for that reason, we also have the
const
keyword to avoid writing on pointed datas. The last reason i see wee use pointers for, it is because sometimes, we don't use variable names to refer to datas (tables, vectors, queues...). We so don't have other way to manipulate these addresses that with pointers... TOXCCT alias Nicolas C.