Skip to content

Conversation

@ANJAN-23
Copy link

Description of Change

This PR improves input validation and robustness of the singly linked list implementation.

Key improvements:

  • Enhanced digit validation by handling empty strings and using std::isdigit safely with unsigned char.
  • Renamed isDigit to is_digit to follow naming conventions.
  • Added <cctype> include for proper character classification.
  • Improved user input handling in main() to prevent invalid menu and element inputs.
  • Ensured the program repeatedly prompts the user until valid numeric input is provided.

These changes make the implementation safer, more user-friendly, and prevent undefined behavior caused by invalid input.


Checklist

  • Added description of change
  • Added file name matches file name guidelines
  • Added tests and example test must pass
  • Added documentation so that the program is self-explanatory and educational
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Improves input validation and digit checking for safer user interaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant