c check if character is a punctuation
char ch = '!'; if(ispunct(ch)) printf("punctuation"); else printf("other symbol" ); // output: punctuation CCopy
Source: iq.opengenus.org
char ch = '!'; if(ispunct(ch)) printf("punctuation"); else printf("other symbol" ); // output: punctuation CCopy