atoi() modified to work with positive and negative numbers #140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To whom it may concern,
my name is Heber Damián Alturria and i have noticed that atoi() only return 0 when we pass as input a string that represent a negative number such as "-1" or if it have a positive sign such as "+1".
To solve the aforementioned situation, i have modified the implementation of atoi() to permit the use of positive and negative signs, resulting in results as interesting as:
As you can appreciate, the operation of the atoi() that I have modified is similar to the atoi() provided by the C library called stdlib.h.
thank you very much for reading and I hope you will consider adding the modification I have provided to the atoi().
best regards.