Skip to content

coderzaman/Check-whether-the-given-string-is-a-valid-identifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

# Identifier Validator

This C++ program checks whether a given input string is a valid identifier. An identifier is considered valid if it follows the standard rules for identifiers in C/C++.

## Features

- Validates identifiers based on common rules.
- Accepts user input for flexible testing.
- Includes checks for underscores, lowercase letters, uppercase letters, and digits.

## Usage

1. **Compile the Code:**
   - Clone the repository to your local machine.
   - Compile the code using a C++ compiler.

2. **Run the Program:**
   - Execute the compiled binary.
   - Enter an identifier when prompted.

3. **View the Result:**
   - The program will output whether the entered identifier is valid or not.

## Code Structure

The code is organized into the following sections:

- **Input Collection:** Uses `getline` to collect an identifier from the user.
- **Validation:** Implements logic to check the validity of the identifier.
- **Output Presentation:** Displays the result indicating whether the identifier is valid.

## Example

```cpp
// Example Input
Please Enter Your Identifier: myIdentifier123

// Example Output
myIdentifier123 is a Valid Identifier.

Contribution

Contributions to this project are welcome. If you find issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.


Author: Aktaruzzaman

Contact: Message me on github.