I've discovered the usage of library in C++ which is
ctype.h
I have an user input which is a string to accept words and is doing error handling using ispunct()
to not accept punctuations. But I want ispunct()
to accept " ' ". Is there anyway for me to set the the parameter to skip " ' "?
If I understand your question correctly, you want to have
ispunct
return false on a'
character. You can just write a custom wrapper to it if this is the case.Which first checks to see if
c
is a'
. If it is, it returns 0, otherwise it passesc
toispunct
and returns from that.