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 6822867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:42:52+00:00 2026-05-26T21:42:52+00:00

Does the C++ Standard Library define this function, or do I have to resort

  • 0

Does the C++ Standard Library define this function, or do I have to resort to Boost?

I searched the web and couldn’t find anything except Boost, but I thought I’d better ask here.

  • 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-26T21:42:53+00:00Added an answer on May 26, 2026 at 9:42 pm

    Only partially.

    C++11 <string> has std::to_string for the built-in types:

    [n3290: 21.5/7]:

    string to_string(int val);
    string to_string(unsigned val);
    string to_string(long val);
    string to_string(unsigned long val);
    string to_string(long long val);
    string to_string(unsigned long long val);
    string to_string(float val);
    string to_string(double val);
    string to_string(long double val);
    

    Returns: Each function returns a string object holding the
    character representation of the value of its argument that would
    be generated by calling sprintf(buf, fmt, val) with a format
    specifier of "%d", "%u", "%ld", "%lu", "%lld", "%llu",
    "%f", "%f", or "%Lf", respectively, where buf designates
    an internal character buffer of sufficient size.

    There are also the following that go the other way around:

    [n3290: 21.5/1, 21.5/4]:

    int stoi(const string& str, size_t *idx = 0, int base = 10);
    long stol(const string& str, size_t *idx = 0, int base = 10);
    unsigned long stoul(const string& str, size_t *idx = 0, int base = 10);
    long long stoll(const string& str, size_t *idx = 0, int base = 10);
    unsigned long long stoull(const string& str, size_t *idx = 0, int base = 10);
    float stof(const string& str, size_t *idx = 0);
    double stod(const string& str, size_t *idx = 0);
    long double stold(const string& str, size_t *idx = 0);
    

    However, there’s nothing generic that you can use (at least not until TR2, maybe!), and nothing at all in C++03.

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

Sidebar

Related Questions

Does C++ standard library and/or Boost have anything similar to the filter function found
Does anyone know why there is no snwprintf function in the C standard library?
Does the Java standard library have any functional data structures, like immutable Sets, Lists,
Why does C++ standard library work with a comparison function that is strict weak
Does the standard library have a BigInt class? (numbers with many digits held in
Does Ruby's standard library have a priority queue implementation?
Does the C++ standard library have an ordered set datastructure? By ordered set, I
I am writing a library in standard C++ which does the phonetic conversion. I
Does the C standard support something similar to __func__ for the function arguments' names?
Does VS2008 have somewhat C++0x standard support? DUPLICATE Visual Studio support for new C

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.