I am trying to find if there is better way to check if the string has special characters. In my case, anything other than alphanumeric and a \'_\' is considered a special charac
The functions (macros) are subject to locale settings, but you should investigate isalnum() and relatives from or .
isalnum()