I am having a string/char array in which I want to test if any invalid character set(which is out of 0-127 standard character) exist.So what are the standard library functions available for this?
This requires second argument as character to match.This character I can't provide, as my purpose is to just check whether given string contains any invalid character set.
Right, but you're also making up your own, slower, function. There is no standard library function specialized for finding ascii characters. In UNIX there is isascii() from ctype, but he didn't specify his platform so I assumed windows, the most common one.
EDIT: Actually, I'm sorry your code just doesn't compile. I'm attempting to fix it and test it.
I have a feeling that function objects are better but I can't remember where I got this from. It is to do with the compiler being ably to optimise them better.
The C++ version builds in 12 seconds. The C version isn't much faster. Most of the time is spent running resource compiler (which does nothing as there's no input) and running the linker with its manifest nonsense.
What kills C++ compile times is processing those massive include files. But on a single file, the overhead is in the tools.