FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[Original HTTPS Page]
cpp-tutorials/015-ptr-vs-ref-for-output at main · SuboptimalEng/cpp-tutorials · GitHub
SuboptimalEng
/
cpp-tutorials
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
17
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-tutorials
/
015-ptr-vs-ref-for-output
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
Breadcrumbs
cpp-tutorials
/
015-ptr-vs-ref-for-output
/
Copy path
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
Makefile
Makefile
README.md
README.md
main.cpp
main.cpp
README.md
Outline
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
Google C++ Style Guide, Inputs and Outputs -
https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs
ChatGPT and Gemini
Back
|
FazBrowse Home
|
New Git URL