+ 1
Why we use pointer?
Why we use pointers? As we can do it normally using variables
4 odpowiedzi
+ 6
Pointer are the most strong and fast part of c/c++ to operate with variables, functions,methods and objects. On the other hand they are also the most dangerous part of the c/c++. Pointers are necessary for changing value of variables inside the function for example. It is also usable in c# but it is necesary to specify the part of code as unsave.
+ 2
pointers are variable contains directly memory addresses (objects,methods,variables) it is very easy to overwrite it,forgot release allocated block of memory, to access beyond the limits (means out of allocated array).Simply sad,working directly with memory is dangerous all the time.To avoid these threads is good to use smart pointers (library for working with pointers by safer way).
0
@high man how it can be dangerous