in this article we will learn about the terms Keywords in C Language, Identifiers in C Language, Rules For Naming identifiers in C, Valid And Invalid identifiers in C, Example OF Valid And Invalid identifiers in C And Types Of identifiers in C.
We Will Discuss About the Definition Of Keywords And Definition Of Identifiers in C Language. we Will Also know about the Difference between Keywords And Identifiers.
- Also Read: Introduction To C | Features And Advantage Of C Language
Conclusion:
Tags: Keywords in C, Identifiers in C, Keywords And Identifiers in C, Difference Between Keywords And Identifiers, Rules For Writing An Identifier Name, Types Of Identifier in C, Constants in C, Variables in C, 32 Keywords In C Language, What is Keywords in C, What is Identifiers in C Language
We Will Discuss About the Definition Of Keywords And Definition Of Identifiers in C Language. we Will Also know about the Difference between Keywords And Identifiers.
Keywords in C
Keywords are those words whose meaning is already defined by Compiler. Keywords are predefined words that has special meaning to the compiler. it cannot used as the name of identifier.
We know that the source code c is firstly translated by compiler to generate executable code and hence it is necessary that compiler can understand each word of the source code, there are two types of words used in source code i.e. Keywords And identifiers. We will discuss about identifiers later. Keywords are those words whose meaning is already known by Compiler. There are 32 keywords in C. we will discuss about each keywords in our future posts.
Main Points:
- Keywords are those words whose meaning is already defined by Compiler.
- There are total 32 keywords in C Language.
- C Keywords are also called Reserved words.
- keywords cannot be used as identifier name.
The meaning of Keywords is already defined to the Compiler, These meaning of Keywords cannot be changed that's why keywords cannot used as identifier, because if they used as an identifier then they will try to change the meaning of keywords which is not possible.
Identifiers in C
Identifiers are name given to entities in Programming Statements, such as variables, functions, structures, etc.
You can say that A program have many words which are not keywords, they are the name of Variables, functions or other entities which is given by programmer that words are called identifiers in c language.
For Example: int Money;
here Money is an identifier and int is a keyword.
Rules For Write Identifier Name:
- An identifier can only have alphanumeric characters (a-z, A-Z, 0-9) or underscore ( _ )
- The first character of an identifier can only contain alphabet (a-z, A-Z) or underscore ( _ ). First Character of an identifier can not be a digit.
- identifiers are also case sensitive in c. for example Num And num are two different identifiers in c.
- Keywords cannot be used as an identifier.
- No Special character except underscore is allowed to use in c as an identifier.
Difference Between Keywords And Identifiers in C
Keywords are predefined reserved words, that has special meaning defined by compiler. Keywords can not be used as an identifier.
An identifier is a unique name given to a variable or a function.
For Creating a variable both (keyword and identifier) are bind together.
e.g. int num;
here int is a keyword and num is an identifier.
Note: Don't worry, we will learn about variable and function in our next articles.
Types Of Identifiers in C
we know that identifier is a user defined name given to a variable or a function, identifiers has two main type on the basis of its meaning i.e. Constants And Variables.
- Constants: In mathematics we have read that constants are those entity whose value does not change. that is also true for programming languages, But in the term of software development we define it in another way.
- Constants: In mathematics we have read that constants are those entity whose value does not change. that is also true for programming languages, But in the term of software development we define it in another way.
Every software is developed for manage some type of data, For example our mobile has a software i.e. Phonebook in which we save our contacts, that software manage Names, Phone Numbers and such things in our mobile that information which is managed by software is called constants.
There are two types of constants in c language.
- Variables: Each Program get some memory in RAM (Random Access Memory) when they start executing. They get memory in RAM for mainly two purpose that is too store instructions and too store data. like if there is a statement Add two numbers 2 and 4, here Add is an instruction and 2 And 4 are data. The memory locations in which that data are stored is called variable.
in short words you can say that variables are name given to memory locations.
For example, if you are writing a program for find sum of two numbers then you should create three variables, 2 for store data on which you will perform the task and one for store the result.
in our next post we will discuss about the details of Constants and Variables.
Conclusion:
In this article we learn about Keywords And Identifiers in C, Difference Between Keywords And Identifiers, Rules For Writing An Identifier Name, Types Of Identifier in C, Constants in C, Variables in C
- Also Read: Introduction To C++ | Introduction To Java
- Also Read: Introduction To C++ | Introduction To Java
Thank You !!
Tags: Keywords in C, Identifiers in C, Keywords And Identifiers in C, Difference Between Keywords And Identifiers, Rules For Writing An Identifier Name, Types Of Identifier in C, Constants in C, Variables in C, 32 Keywords In C Language, What is Keywords in C, What is Identifiers in C Language