Sign in to follow this  

Wrapping sscanf_s

This topic is 3341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this