answersLogoWhite

0


Best Answer

Keywords in a programming language are reserved for a special use. Words like if, while, for, etc. are common keywords among different languages.

Identifiers are the names given to variables, functions, structures, and classes (in order to identify them). Identifiers cannot be keywords.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago
KeywordsC keeps a small set of keywords for its own use. These keywords cannot be used as identifiers in the program - a common restriction with modern languages. Where users of Old C may be surprised is in the introduction of some new keywords; if those names were used as identifiers in previous programs, then the programs will have to be changed. It will be easy to spot, because it will provoke your compiler into telling you about invalid names for things. Here is the list of keywords used in Standard C; you will notice that none of them use upper-case letters.autodoubleintstructbreakelselongswitchcaseenumregistertypedefcharexternreturnunionconstfloatshortunsignedcontinueforsignedvoiddefaultgotosizeofvolatiledoifstaticwhileTable 2.3. Keywords

The new keywords that are likely to surprise old programmers are: const, signed, void and volatile (althoughvoid has been around for a while). Eagle eyed readers may have noticed that some implementations of C used to use the keywords entry, asm, and fortran. These are not part of the Standard, and few will mourn them.

IdentifiersIdentifier is the fancy term used to mean 'name'. In C, identifiers are used to refer to a number of things: we've already seen them used to name variables and functions. They are also used to give names to some things we haven't seen yet, amongst which are labels and the 'tags' of structures, unions, and enums.

The rules for the construction of identifiers are simple: you may use the 52 upper and lower case alphabetic characters, the 10 digits and finally the underscore '_', which is considered to be an alphabetic character for this purpose. The only restriction is the usual one; identifiers must start with an alphabetic character.

Although there is no restriction on the length of identifiers in the Standard, this is a point that needs a bit of explanation. In Old C, as in Standard C, there has never been any restriction on the length of identifiers. The problem is that there was never any guarantee that more than a certain number of characters would be checked when names were compared for equality-in Old C this was eight characters, in Standard C this has changed to 31.

So, practically speaking, the new limit is 31 characters-although identifiers may be longer, they must differ in the first 31 characters if you want to be sure that your programs are portable. The Standard allows for implementations to support longer names if they wish to, so if you do use longer names, make sure that you don't rely on the checking stopping at 31.

One of the most controversial parts of the Standard is the length of external identifiers. External identifiers are the ones that have to be visible outside the current source code file. Typical examples of these would be library routines or functions which have to be called from several different source files.

The Standard chose to stay with the old restrictions on these external names: they are not guaranteed to be different unless they differ from each other in the first six characters. Worse than that, upper and lower case letters may be treated the same!

The reason for this is a pragmatic one: the way that most C compilation systems work is to use operating system specific tools to bind library functions into a C program. These tools are outside the control of the C compiler writer, so the Standard has to impose realistic limits that are likely to be possible to meet. There is nothing to prevent any specific implementation from giving better limits than these, but for maximum portability the six monocase characters must be all that you expect. The Standard warns that it views both the use of only one case and any restriction on the length of external names to less than 31 characters as obsolescent features. A later standard may insist that the restrictions are lifted; let's hope that it is soon.

- Madhu Chakkaravarthy.R

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Identifier is a condition for true or false value and particular concept is called identifier

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you mean by identifier and keywords?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can a reserved word be used as an identifier name?

Identifiers are a bit more generic in the context of programming. If you mean, in terms of the C languages (C, C++, C#), the question is the reverse...keywords may NOT be used as identifiers. For example, you cannot use keywords such as "int", "float", "double", etc. as the names of variables or objects.


Can keyword be used as variables?

No, any keyword could be used as a identifier (a method, class or variable name). These keywords have a special meaning in the language and the compiler can not identify if they are used as a variable name or as a keyword,


Can identifier be any sequence of digits and letters?

If you mean a variable name, then no -- it must begin with a letter or an underscore, but any combination of letters, digits and underscores may follow. If you mean a variable that stores an identifier, then yes -- so long as the identifier is a string type.


Differentiate keywords and identifiers in C programming?

keywords:- every word in a c program is either a keyword or an identifier. All keywords are basically the sequences of characters that have one or fixed meanings. And these meanings in any circumtances , can't be changed. All c keywords must be written in lowercase (small) letters. eg:- auto, break ,case, char, const, do, if ,double, else .....etc identifiers:- identifiers r names given to program elements such as variables , arrays & functions. Basically identifers r the sequences of alphabets or digits. Rules for forming identifier name * the first character must be analphabet (uppercase or lowercase) or an underscore * all succeeding characters must be letters or digits. * no special characters or punctuatio symbols are allowed except the underscore"_". * no two successive underscores are allowed. * keywords shouln't be used as identifiers.


Is it possible to declare a keyword as an identifier in c plus plus?

No. Keywords are reserved and cannot be used as identifiers. However, C/C++ is case-sensitive. So although register is a reserved keyword, Register is not.

Related questions

Can a reserved word be used as an identifier name?

Identifiers are a bit more generic in the context of programming. If you mean, in terms of the C languages (C, C++, C#), the question is the reverse...keywords may NOT be used as identifiers. For example, you cannot use keywords such as "int", "float", "double", etc. as the names of variables or objects.


What do keywords mean in Metal Gear Solid portable ops?

what is the meaning keywords what is the meaning keywords


Why keywords in java important?

In the Java programming language, a keyword is one of 53 reserved words that have a predefined meaning in the language; because of this, programmers cannot use keywords as names for variables, methods, classes, or as any other identifier.


Can keyword be used as variables?

No, any keyword could be used as a identifier (a method, class or variable name). These keywords have a special meaning in the language and the compiler can not identify if they are used as a variable name or as a keyword,


What is identify mean?

Identifier is a condition for true or false value and particular concept is called identifier


What does the identifier mean on babydow?

Your username/your account.


What does novamill mean?

what does the word novamill in keywords mean.


Can identifier be any sequence of digits and letters?

If you mean a variable name, then no -- it must begin with a letter or an underscore, but any combination of letters, digits and underscores may follow. If you mean a variable that stores an identifier, then yes -- so long as the identifier is a string type.


What is meant by static identifier?

Nothing. I guess you mean a static variable.


Differentiate keywords and identifiers in C programming?

keywords:- every word in a c program is either a keyword or an identifier. All keywords are basically the sequences of characters that have one or fixed meanings. And these meanings in any circumtances , can't be changed. All c keywords must be written in lowercase (small) letters. eg:- auto, break ,case, char, const, do, if ,double, else .....etc identifiers:- identifiers r names given to program elements such as variables , arrays & functions. Basically identifers r the sequences of alphabets or digits. Rules for forming identifier name * the first character must be analphabet (uppercase or lowercase) or an underscore * all succeeding characters must be letters or digits. * no special characters or punctuatio symbols are allowed except the underscore"_". * no two successive underscores are allowed. * keywords shouln't be used as identifiers.


Is it possible to declare a keyword as an identifier in c plus plus?

No. Keywords are reserved and cannot be used as identifiers. However, C/C++ is case-sensitive. So although register is a reserved keyword, Register is not.


Difference between identifier and reserved word?

A keyword is a reserved word, used by the programming language to establish actions or commands. For example, in the line: while (value < 100) { //block of code } "while" is a keyword, used to indicate iteration (loop) of what's inside the block of code. variables are user-defined words that are able to hold values. In the previous case, "value" can be thought as a variable.