So I need to validate the input that the user enters. The user has to enter his name , and the program must check that the name's characters are from the alphabet , but the single quote ' and space can also be used.
No other symbols or punctuation must be used.
I know how to do all these validations , except the one where the single quote character has to be valid ad not assumed as other punctuation. I did the part where it checks that it name is from the alphabet , but how can I escape the single quote character and the space , so that they are also valid ?
I did this to validate if they are from alphabet , how can I modify this so that it can also accept single quotes and spaces ?
Code:for (i = 0; i < length; i++) { if (!isalpha(name[i])) { printf("No punctuation is allowed except single quotes and spaces.\n\n"); return 0; }