Wrapping sscanf_s
I am using sscanf_s throughout my code and would like to wrap it in a function like String_Sscanf(). Should I unpack the variable list using stdarg and then repack them to pass them on to sscanf_s()?
void String_Scanf( const char *buffer, const char *format, ... )
{
// how do I pass the variables on to sccanf?
}
Thanks for the help
Normally you would use vsscanf along with a va_list, however Microsoft doesn't include that function so you need to either implement it yourself or grab a cross platform one and include it in your project. Also sscanf_s is "secure", your String_Scanf should probably take the length of the buffer as an argument.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement