![]() |
In C++ programming language, identifiers are the unique names assigned to variables, functions, classes, structs, or other entities within the program. For example, in the below statement, int num = 11;
num is an identifier. Rules to Name of an Identifier in C++We can use any word as an identifier as long as it follows the following rules:
Additionally, C++ is a case-sensitive language so the identifier such as Num and num are treated as different. The below images show some valid and invalid C++ identifiers. ![]() Example of Valid/Invalid Identifiers Example of C++ IdentifiersIn this example, we have used the identifiers by following the guidelines and we use identifiers to name a class, function, integer data type, etc. If you are not aware of functions and classes in C++ then don’t you will learn them soon. The below code is run successfully which means we named them correctly. C++
Output
The sum is: 12 |
Reffered: https://www.geeksforgeeks.org
C++ |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |