How do i declare a variable in c++ : C++ Tutorial

Published: 31 August 2019
on channel: Learn Python
306
4

3. Variable declaration In C++
Variables are the storage for data values, they are like rooms for storing data. Before using any variable, you must declare it and that is what is called variable declaration.

The following rules must be considered during variable declaration.
1. Variable name can not be keyword such as else, break, case, for and other keywords in C++. 2. Variable name can not contain space between it. For example, string first name is wrong variable declaration, it should be string firstname that is without space or it should contain underscore string first_name.
3. It should start with letter or underscore.
4. It should not contain special characters like $, @, £, # and other special characters.
In the video above 5, x, name and salary are the variables being declared, that is declaration of variables.

This is the program number 3 in Simplified C++ 40 programs
Link Of Book - https://www.slideshare.net/MoTechInc/...
Link Of Source codes - https://github.com/MoTechStore/Simpli...
Instructor : Noel Moses Mwadende
Company : MoTech

SUBSCRIBE for getting notifications of upcoming tutorials at MoTech COMPUTERS:
https://www.youtube.com/motechstore?s...

Please like this video and put in your comments
Follow me on Instagram :   / motech_tz  

#Cpluplusvariable #Cpluplusdeclarevarible #Cplusplusforbeginner #Cpluplusexamples


On this page of the site you can watch the video online How do i declare a variable in c++ : C++ Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Learn Python 31 August 2019, share the link with friends and acquaintances, this video has already been watched 306 times on youtube and it was liked by 4 viewers. Enjoy your viewing!