Hello
First of all, I want to thank @acidyo, @cadawg, @deathwing & @rishi556,@ocdb, @usainvote, @newsflash, @ocd, @joshman and other friends for their support. Today I want to talk about a concept called variable and identifier and its types in programming languages.
We're dealing with two memories. One is RAM and the other is hard drive. The difference between the two, and what is important to us, is that what is stored in RAM is lost after the computer is reset or turned off, but what you save on the hard drive remains.
In programming, if you save data in a file, this data remains, but by saving in RAM, the data can be lost.
The similarity between the two, which is important to us, is that the data, whether stored on the hard drive or in RAM, can be edited and replaced with new data. As soon as this change, the previous data will be lost.
understanding variables
The address of a place in memory that we give a name to and from that moment on, we can access the contents of that place with the same name and manipulate its data.
To understand this, I will give an example. Look at the picture below:
We have different boxes, each with a different address. We assign three names to the three boxes and then issue the following three commands:
- Put the content of height in age: The result of this command is as follows
- Put the content of weight in height: The result is as follows
- Put the content of age in weight: Listen to the result
You can see the sum of all the above three commands in the last figure.
The concept of variable is the same in all languages and all you have to do is understand this concept and then know how to define a variable in that particular language - whether Python, C, etc.
Identifier concept
We said you have to specify a name for the variable. The name we specify for the variable is called the identifier.
Whatever language you work with, you have three concepts:
- Keywords: Reserved words that perform a specific action. These words belong to that language and have a special meaning for the compiler.
- Standard IDs: Words that, although not reserved, still perform a specific function. For example, the name of the definition functions within the language
- Non-standard identifiers: All names you define, such as variable names
The law of determining the identifier
Each language has a rule for defining an ID name. It's usually as follows
- The name you choose should not be a keyword or preferably a standard identifier. Of course, some languages allow the definition of standard identifiers, but it is better to follow a general rule
- Specific length: Each language has a length range for the number of characters, for example in c, the length of your ID can be up to 63 characters.
- Sensitivity: Some languages are case-sensitive, such as C, and others, such as Pascal, don't distinguish between uppercase and lowercase letters. My advice to you is to think, it's case-sensitive.
- In determining the ID name, you can follow the following three rules, which are common:
a. Start with a letter [a-z A-Z] or _.
b. The name can include numbers [0-9], letters [a-z A-Z] and _
c. Do not use any other symbols except _.
d .There should be no space in the name.
thanks to:
@ocdb @usainvote @newsflash @ocd @joshman @meritocracy @postpromoter @pishio @howo @belemo @takowi @steempress @bdmillergallery @roelandp @kevinwong @ocd-witness @eonwarped @pladozero @jlsplatts @walterjay @devann @dcrops @tipy @kephler @actioncats @quochuy @smartvote @dora381 @babeltrips @sunnyvo
Congratulations @leo32! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):
Your next target is to reach 50 upvotes.
Your next target is to reach 200 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Check out the last post from @hivebuzz:
Support the HiveBuzz project. Vote for our proposal!
Please don't mass ping people, people hate to be notified when it's irrelevant to the post and it's likely to result in downvotes.
!LUV
!LUV
!LUV