pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/SuboptimalEng/cpp-tutorials/tree/main/015-ptr-vs-ref-for-output

tylesheet" href="https://github.githubassets.com/assets/repository-6534fbc3f5e83ac0.css" /> cpp-tutorials/015-ptr-vs-ref-for-output at main · SuboptimalEng/cpp-tutorials · GitHub
Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Ptr vs Ref for Output Params

TL;DR

  • Why pass-by-ptr is better than pass-by-ref for output params in C++
  • This is recommended by Google C++ style guide (used in industry)

Video Overview

  • C++ double variables and add function example
  • Output params - pass variable by reference
  • Output params - pass variable as a pointer
  • Which approach is better (simpler, readable, maintainable, code story)
    • Prefer using return values over output params (if possible)
    • Google C++ style guide recommends the pointer approach
  • AI vibe coding, code reviewing rant

Titles

  • Google C++ Style Guide: Pointers vs References for Output
  • C++ Pointers vs References: Which is Better for Outputs?
  • Google C++ Coding Standards: Why use Pointers for Out Parameters?
  • How to Guide AI to Write Clean C++ (Google Style Edition)
  • Vibe Coding C++: Why You Need the Google Style Guide
  • Prompting for Performance: Using Google C++ Rules in Cursor AI
int sum(int& a, int* b);

Timestamps

  • 00:00 Intro

References

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy