Jump to content
  • Advertisement
Sign in to follow this  
auser2008

Wrapping sscanf_s

This topic is 3550 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!