C++, C, Pointers and References

I finally got this down:

  1. Pointers and references: the difference between them and where each is used.

  2. Passing either an array or a vector into a function and returning another array or vector from the function.

  3. The syntax of pointers, references and arrays in C is almost identical to their syntax in C++. C even has structs.

  4. C has a syntax that is a subset of C++. You can usually copy C code straight into a C++ program, perhaps only requiring an include statement for the relevant library.

  5. Pointers and references are cool and a piece of cake once you get the hang of reading their declarations and statements in the correct order to translate them into plain English. I found this and this very helpful in that regard.

  6. Stack and heap, when and how to use one or the other.

3 Likes