Skip to main content

Identifiers




A valid identifier is a sequence of one or more letters, digits, or underscore characters ( _ ). Spaces, punctuation marks, and symbols cannot be part of an identifier. In addition, identifiers shall always begin with a letter. They can also begin with an underline character ( _ ), but such identifiers are -on most cases- considered reserved for compiler-specific keywords or external identifiers, as well as identifiers containing two successive underscore characters anywhere. In no case can they begin with a digit.

C++ uses a number of keywords to identify operations and data descriptions; therefore, identifiers created by a programmer cannot match these keywords. The standard reserved keywords that cannot be used for programmer created identifiers are:

alignas, alignof, and, and_eq, asm, auto, bitand, bitor, bool, break, case, catch, char, char16_t, char32_t, class, compl, const, constexpr, const_cast, continue, decltype, default, delete, do, double, dynamic_cast, else, enum, explicit, export, extern, false, float, for, friend, goto, if, inline, int, long, mutable, namespace, new, noexcept, not, not_eq, nullptr, operator, or, or_eq, private, protected, public, register, reinterpret_cast, return, short, signed, sizeof, static, static_assert, static_cast, struct, switch, template, this, thread_local, throw, true, try, typedef, typeid, typename, union, unsigned, using, virtual, void, volatile, wchar_t, while, xor, xor_eq

Specific compilers may also have additional specific reserved keywords.

Very important: The C++ language is a "case sensitive" language. That means that an identifier written in capital letters is not equivalent to another one with the same name but written in small letters. Thus, for example, the RESULT variable is not the same as the result variable or the Result variable. These are three different identifiers identifiying three different variables.

Popular posts from this blog

Master Excel: Unleash Pro-Level Skills with These Tips and Tricks

7 Best Free Machine Learning Resources - 2022

  Google AI ai.google Education – Google AI Learn with Google AI. Whether you're just learning to code or you're a seasoned machine learning practitioner, you'll find information and exercises in this resource center to help you develop your... Learn from ML experts at Google. Understanding Machine Learning From Theory to Algorithms The term machine learning refers to the automated detection of meaningful patterns in data. https:// cs.huji.ac.il/w~shais/Unders Machine Learning & Deep Learning Tutorials github.com GitHub - ujjwalkarn/Machine-Learning-Tutorials: machine learning and deep learning tutorials,... machine learning and deep learning tutorials, articles and other resources - GitHub - ujjwalkarn/Machine-Learning-Tutorials: machine learning and deep learning tutorials, articles and other resources This repository contains a topic-wise curated list of Machine Learning and Deep Learning tutorials, articles, and other resources. AI Weekly aiweekly.co AI ...