Returning from a Function | C++ Practice, Examples, and How-To Guide

  Рет қаралды 948

Code, Tech, and Tutorials

Code, Tech, and Tutorials

Жыл бұрын

Sampling some differing return options when using C++. There are a lot of things to keep in mind when you want to return a value from a function.
---
Notable Video Resources:
▶ en.cppreference.com/w/cpp/lan...
---
Join the Discord ▶ / discord
Join the Patreon ▶ patreon.com/codetechtuts?utm_...
Join the Channel ▶ / @codetechandtutorials
---
Video Written, Edited, & Produced By:
▶ Matthew Early
---
Some of Matt's Other Stuff (feel free to follow and support!):
- linktr.ee/mearly

Пікірлер: 6
@oldsunup
@oldsunup Жыл бұрын
Thanks for the video, very informative and well explained !
@reverse_shell
@reverse_shell Жыл бұрын
You're all good on the pass-by-reference btw! :) Happy Humpday Video Release!!
@juanpablohernandezvogt
@juanpablohernandezvogt Жыл бұрын
I'm not going to Google it,so I'll risk my answer: using references & you are safe having something, instead * where you can receive a nullptr. PS: "std::cout" kills my eyes when you included "using namespace std;" some lines before :P
@CodeTechandTutorials
@CodeTechandTutorials Жыл бұрын
You're sorta right about the ref and pointer only I would add that having a guaranteed something isn't as safe as we would hope, as it could be the wrong something (as shown in one of the examples) and hard to troubleshoot why it is producing the wrong result and not crashing. Unit tests would should catch something like that though. Also, the `using namespace std;` was part of the template, I didn't type that out so I forgot it was even there.
Other Great C++ (related) Coding Channels I Tend To Watch
15:14
Code, Tech, and Tutorials
Рет қаралды 3,5 М.
CMake Tutorial EP 14 | CDash
30:12
Code, Tech, and Tutorials
Рет қаралды 2,7 М.
🌊Насколько Глубокий Океан ? #shorts
00:42
OMG😳 #tiktok #shorts #potapova_blog
00:58
Potapova_blog
Рет қаралды 4,4 МЛН
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 4,5 МЛН
lvalues and rvalues in C++
14:13
The Cherno
Рет қаралды 305 М.
The Bridge Design Pattern (as RPG Player Character) - Ep 23 - C++ Coding
32:35
Code, Tech, and Tutorials
Рет қаралды 1,9 М.
ASMR Programming - Spinning Cube - No Talking
20:45
Servet Gulnaroglu
Рет қаралды 3,7 МЛН
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 370 М.
Turning A Rigid Dynamic Capsule into a Player Controller... - NVidia PhysX
22:04
Code, Tech, and Tutorials
Рет қаралды 1,9 М.
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 604 М.
Why I Don't Use Else When Programming
10:18
Web Dev Simplified
Рет қаралды 1,2 МЛН
Maps in C++ (std::map and std::unordered_map)
30:00
The Cherno
Рет қаралды 201 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,7 МЛН
Как слушать музыку с помощью чека?
0:36
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,5 МЛН