what is variable in c++?
An entity that may vary during program execution is called variable. variable name in c++ programming is the name of location in memory . different type of variable use in c++ programming. e.g integer variable etc certain type can hold certain value. mean integer variable can hold integer value.
RULES FOR CONSTRUCTION VARIABLE NAME:
1) A variable is combination of alphabets, digits or underscores.
2)first character of variable must be alphabet or underscore.
3) No commas or blank space are allow in variable.
4)No special symbol and character can be use within variable name expect underscore,
5)C++ keyword can not be use as c++ variable
Example of variable name:
s_name //valid
_val //valid
4name //invalid because first character must be alphabet or underscore
int //invalid because it is c++ keyword
keyword in c++:
keyword are the words whose meaning already been explained in c++ compiler.
list of keyword in c++:
0 comments:
Post a Comment