coderzaman / Check-if-a-given-string-is-a-comment-or-not

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C, C++, Java Comment Detection

This C++ program allows users to input a code snippet and determines whether it contains a single-line comment (//), a multi-line comment (/* */), or no comments at all. The program uses a stack-based approach to efficiently parse and identify different types of comments within the given input.

Features

  • Single-Line Comment Detection: Identifies and reports single-line comments in the code.
  • Multi-Line Comment Detection: Detects and reports properly closed multi-line comments.
  • User Input: Enables users to input code snippets for comment detection.

Usage

  1. Run the program:

    • Clone the repository to your local machine.
    • Compile and run the program using your preferred C++ compiler.
  2. Input the code snippet:

    • Follow the prompts to input your code snippet.
  3. Receive Output:

    • The program will provide a clear output indicating the presence or absence of comments in the provided code.

How to Contribute

Contributions are welcome! If you have ideas for improvements or encounter issues, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgments

  • This project is inspired by [mention any sources or inspirations if applicable].

Author

[Aktaruzzaman]

Contact

[message me on my github profile]