Ask Question

An identifier that is prefixed with an @ and allows you to use code written in other languages that do not have the same set of reserved keywords is known by what name?

+3
Answers (1)
  1. 31 August, 15:00
    0
    Verbatim Identifier

    Explanation:

    Verbatim Identifier contains @ symbol as a prefix by which enables you to use reserved words of a programming language as identifier. For example the keywords like int, double, goto, char, else, while, for, float etc can be used as strings or variable names if @ symbol is added before these words e. g. @char, @while, @void, @int etc. The compiler of a language will recognize such identifiers as verbatim identifiers and compiles them without giving an error that these are reserved words. Verbatim identifier is used for program that is written in other languages and those languages don't have same reserved words. For example: cout<<"use of verbatim identifier"; <<@for; In this statement, for keyword which is used in for loop can be used as an identifier with @ in the prefix. The escape sequences if used with @ symbol in prefix then they are interpreted in a different way. For example in C#

    string a = "//C:/torrent/new/file";

    Console. WriteLine (a);

    This statement will give the following output:

    /C: orrent

    ewfile

    This means that the / t in the start of torrent and / n in the start of new word is taken as an escape sequence and output displayed is giving tab space because of / t and prints the rest of the words in new line because of / n escape sequence.

    Now lets use this with the @ symbol

    string a = @"//C:/torrent/new/file";

    Console. WriteLine (a);

    The output will now be:

    //C:/torrent/new/file

    /t and / n are not taken as escape sequences by the compiler because of @ symbol.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “An identifier that is prefixed with an @ and allows you to use code written in other languages that do not have the same set of reserved ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers