Variable scopes w\ examples (Local vs Global vs Block vs Nested)

preview_player
Показать описание
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️

Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
It is a powerful, secure text editor designed specifically for programmers.

However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇

In programming, a scope is the area of code where you can access a certain variable in order to read it, change its value, and work with that variable in general.
There are four types of scopes:
- global scope
- local/function scope
- block scope
- nested scope
In this video, I'll show you examples of each scope and explain the advantages and disadvantages, as well as when to use each variable scope.

Contents:
00:00 - Summary of what you'll learn in this video
00:31 - What is scope? Types of scopes?
02:28 - Local/function scope w\ examples
06:44 - When to use local scope variables?
08:03 - Global scope w\ examples
11:40 - When to use global scope variables?
13:01 - Block scope w\ examples
16:00 - Nested scope w\ examples

Other courses mentioned in this video:

Add me on:
Рекомендации по теме
Комментарии
Автор

📚 Learn how to solve problems and build projects with these Free E-Books ⬇
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

CodeBeauty
Автор

Thank you CodeBeauty for your tutorials. 👍❤️😊
Very nice music as well.

WDavidCastaneda
Автор

great video, just what i was looking for
thank you for posting

dundyd
Автор

The way you explain everything is really helpful that actually makes the concepts cleared.

MuhammadAhmed-vllq
Автор

great video, very informative, thanks :D

marym
Автор

You will be famous in India.
If you lauch (dsa+competitive programming) course.
Large audience is waiting for such articulate teacher.

MEAmitKourav
Автор

I credit you so much for making me fall in love with programming, thank you so much for your awesome work!

sunbreeze
Автор

i love your videos :D they are the best

phoebewell
Автор

Since watching this video, my programming performance increased.
Understanding a program’s scope should be in a beginning stage of learning.

Matice
Автор

Hi Saldina, Could you do a tutorial about implementing templates in headers and source files?

DeadManRising
Автор

No matter how you say it, you're just awesome.

ankurbode
Автор

You are really good teacher :D
Everything is clearly said❤

Thank you

kacperswiesciak
Автор

Really Great Explanation Saldina 👍. I happened to find your channel through a Medium Blog titled the Best Free You Tube Channels for learning Programming.

vybhaveswaraiah
Автор

Thank you Saldina for these videos, da ne kazem hvala :)

thefossenjoyer
Автор

Why were you not there when I started learning C++!!! I would not be

bimDe
Автор

thanks thanks please always do this style make me go craczy

youssofprogrammer
Автор

Hi! Your every video is worth to watch. Content quality awesome.😍 Can you please make a video on these topic
1-> std::move()
2-->serialization in c++

lettry
Автор

Will you consider making python tutorials too? I know there are other tutorials but you are definitely my favorite.

roshanpoudel
Автор

That's must-know topic for every beginner programmer

raivisrasnacs
Автор

Saldina, Is it possible to make videos to explain the algorithms that are actually used such as Luhn algorithm for example?

ahmadosama