Skip to main content

Identifiers in C++ : Rules for an Identifier

Rules for an identifiers
Rules for an identifiers

Identifiers in C++ : Rules for an Identifier

Identifiers:

Identifiers are the names given to the different entities of the program such as functions, variables, constant, classes, structures, etc. Since identifiers refers to a particular entity of a program so it must be unique for every entities.

Rules for an Identifier:

  1. An Identifier can only have alphanumeric characters(a-z , A-Z , 0-9) and underscore(_).
  2. The  starting character of  identifier can only contain alphabet(a-z , A-Z) or underscore (_).
  3. Identifiers are case sensitive (Similar is in C). For example name and Name are two different identifiers.
  4. Keywords are not allowed to be used as Identifiers.
  5. No special characters or Symbols, such as semicolon, period, whitespaces, slash or comma are permitted to be used in or as Identifier.

Comments

Popular posts from this blog

Understanding KNN(K-nearest neighbor) with example

Understanding KNN(K-nearest neighbor) with example.  It is probably, one of the simplest but strong supervised learning algorithms used for classification as well regression purposes. It is most commonly used to classify the data points that are separated into several classes, in order to make prediction for new sample data points. It is a non-parametric and lazy learning algorithm. It classifies the data points based on the similarity measure (e.g. distance measures, mostly Euclidean distance). Assumption of KNN : K- NN algorithm is based on the principle that, “the similar things exist closer to each other or Like things are near to each other.” In this algorithm ‘K’ refers to the number of neighbors to consider for classification. It should be odd value.  The value of ‘K’ must be selected carefully otherwise it may cause defects in our model. If the value of ‘K’ is small then it causes Low Bias, High variance i.e. over fitting of model. In the same way if ‘K’ is v...

Data Types and modifiers In C++

Data types in C++ Data Types In C++ In computer programming, a data type or simply type is an attribute of data that tells the compiler or interpreter how the programmer intends to use the data. It tells about the size and behavior of data. While writing any code we may need to store our data in different forms and of different size. To do this we need different variables of different data types. e.g if we want to store numbers we may need different data type than that of we required to store alphabets.  When we store something, it means we are reserving space from computer memory. Different data types occupies different memory spaces. If we don't know about them then we may fail to built robust program. so lets see what are the data types that C++ supports and what are their keywords . Primary(Built-in) Data Types: character integer floating point double floating point boolean wide character User Defined Data Types: Structure Union Class Enumeration Derived Data Types: Arra...