What Are C++ Pointers For?

Asked

Viewed 16 times

0

I am studying C++ for about 3/4 weeks, and I always look for some exercises to practice and in several of these exercises I end up encountering Ponteiros.

From what I know so far they store the address in memory, if you make it point to a variable it will contain her address.

So what’s this for? In what situations could the pointer be useful?

  • Pointers point to a memory address, that is, you pass the address with the symbol & to a pointer p* ( int* p = &value; ), and then use it in several other ways (int k = *p;) (*p = 15;), making it easier to manipulate the memory, increasing the speed of the program. For a better explanation of utility, I suggest this post: https://answall.com/questions/244828/na-pr%C3%a1tica-qual-a-utilidade-dos-em-c? noredirect=1&lq=1

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.