46 Comments

  1. To understand pointers, you just need to understand a TINY bit of how a computer actually heckin works. Computers aren't magic boxes, they have three different types of main storage. A hard drive, memory, (and cpu registers but is that really even storage-). In c you'll usually work with the memory, and this memory contains little divisions. Each block of memory has a value assigned to it so that you can access the data stored there. If they weren't named, neither you nor the computer would know where the data is. A pointer is simply a variable that contains this assigned name, usually a hex code of some sort. So, now that you know where the data is stored you can dereference the pointer and perform operations on it such as reading or writing.

  2. I mean yea but it also makes it very clear where pointers are used but I still think not clear enough as I found out that even normal vars are also ptrs this might sound logical as thy have a adres but under the hood you also need to use ptrs to use them it is impossible to make a big program without ptrs (Im someone who learned programming almost alone so I had to learn a little asm and I didn’t know it worked like that 😵‍💫)

  3. The number of people who think pointers are ints or hold ints is insanely worrying. An int is depending on the system, usually 32bits. While pointers are depending on the system, usually 64bits. Beyond that a pointer IS NOT A NUMBER TYPE. It carries alot of additional data at compile time. It is a unique type that is an abstraction over virtual memory. If you MUST work with pointers as raw non-pointer number types you MUST use size_t, its size is determined by the platform and it is allways the same size as a pointer.

  4. Just use smart pointers. It’s a wrapper for raw pointers. They are defined in memory file if I’m not mistaken. They handle all the memory management and you don’t need to concern about this. std::unique_ptr and std::shared_ptr

  5. I learnt C as my first programming language way back in high school. I took a non-mandatory C++ course in the University. I wrote nearly all my software in C… It's hard to argue, really, that I still don't know C++. So, why is this on my YT home page?

  6. Just remember, a pointer is just a variable that is a memory address.

    Just think of void pointers to start with. They are just pure memory addresses.

    Then when you add a type, like integer pointers ( int* ) that's a memory address that gets treated like an interger when you dereference it.

    Once you get a handle on them they aren't too hard. And I recommend anyone learning C or C++ learn pointers early on. This is a big reason why C is so low level and powerful. (It's very low level for a high level language.)

  7. C++ actually makes a lot of sense. Take the basic Hello world program:
    std::cout << "Hello World!";
    So the << operator is the shift left operator. So this command means take the binary number cout, and shift it left by "Hello World!" positions.

Leave a Reply

Your email address will not be published. Required fields are marked *

You might like

© 2026 Cantinho do Vídeo - WordPress Video Theme by WPEnjoy