Bifalgorithm post

You've probably used both references and pointers in C++, but they are not interchangeable, not even close. Let's forget syntax for a second and look at what really set them apart. References must always refer to something valid, but pointers can be null and dangerous. So remember, references are safer, but less flexible. Use the right tool for the job.

You've probably used both references and pointers in C++, but they are not interchangeable, not even close. Let's forget syntax for a second and look at what r…

Ideas in this flowchart

  • References vs Pointers in C++
  • References
  • Pointers
  • Always refer to something valid
  • Safer
  • Less flexible
  • Can be null
  • Can be dangerous
  • Use the right tool for the job
Feed/

You've probably used both references and pointers in C++, but they are not interchangeable, not even close. Let's forget syntax for a second and look at what really set them apart. References must always refer to something valid, but pointers can be null and dangerous. So remember, references are safer, but less flexible. Use the right tool for the job.

"You've probably used both references and pointers in C++,"

👍
0
0 comments0 shares

Sign in to view and post comments.