Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6470691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:08:23+00:00 2026-05-25T06:08:23+00:00

I am trying to use sscanf to separate a string that has a boost

  • 0

I am trying to use sscanf to separate a string that has a boost date. here’s the code:

 std::sscanf(ss.c_str(),"%ls\t%lf\t%lf",&date1_,&num1_,&num2_);

and I get the following error:

 warning: format ‘%ls’ expects type ‘wchar_t*’, but argument 3 has type ‘boost::gregorian::date*’

can anyone suggest me a fix for this. thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:08:24+00:00Added an answer on May 25, 2026 at 6:08 am

    It cannot be done this way. sscanf is a C function and can only read primitive types, not class types.

    In C++ the guns for reading/writing class types are “streams” and come in <iostream> and <sstream> headers. They will work if the authors of the Boost library you’re using were kind enough to overload operator<< and operator>> for this class.

    If the didn’t, then your best shot is to read the date fields (as basic types) one-by-one and then create a boost::gregorian::date object using its constructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my program which reverses a string. I am trying to use function
How can I separate a string that has white spaces between the 3 shorts
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
trying to use regex to replace any white space with &nbsp;, inside of example
I'm trying to convert a string to GUID with sscanf: GUID guid; sscanf( 11111111-2222-3333-4455-667788995511,
I'm a little confused here, I am trying use a partial view in a
I am trying to finish a homework program that compares a string with a
I am trying use std::copy to copy from two different iterator. But during course
I have a regex that I'm trying use to validate against strings. Trying to
I'm trying use preg_match in an IF statement and return false if a string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.