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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:10:24+00:00 2026-06-13T12:10:24+00:00

I am trying to create a long string literal, which I store inside a

  • 0

I am trying to create a long string literal, which I store inside a std::string. If I create a literal up to approximately 2600 characters, everything prints fine. If I go beyond that number of symbols, I only get some random garbage characters printed.

I have been using the C standard as guidance, environmental limits are specified as “4095 characters in a string literal (after concatenation)”. But the code is written in C++.

So my question is, what is the minimum amount of characters in a C++ string literal?

(The problem might possibly be elsewhere in the code, but I would like to ensure that I don’t pass a limit set by the standard. The text is printed in a RichEdit control, so I doubt that one is the culprit.)

  • 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-06-13T12:10:25+00:00Added an answer on June 13, 2026 at 12:10 pm

    The minimum is specified in

    Annex B
    Implementation quantities [implimits]

    Characters in a string literal (after concatenation) [65 536].

    But note that:

    1) Because computers are finite, C++ implementations are inevitably limited in the size of the programs they
    can successfully process. Every implementation shall document those limitations where known. This documentation
    may cite fixed limits where they exist, say how to compute variable limits as a function of available
    resources, or say that fixed limits do not exist or are unknown.

    2) The limits may constrain quantities that include those described below or others. The bracketed number
    following each quantity is recommended as the minimum for that quantity. However, these quantities are
    only guidelines and do not determine compliance
    . (emphasis mine)

    Your implementation should provide you with this number though.

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

Sidebar

Related Questions

I'm trying to create a number of strings based on one long string that
I'm trying to create a long string that is produced out of encrypted substrings.
I am trying to create a floating Context Menu when long pressing a button.
I'm trying to create a AJAX push implementation in PHP using a Comet long-polling
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
I am trying to create a hash for a string of 10 or 16
I'm trying to create a multidimensional array from a string (received from $_GET, input
I'm trying to create a client-server program that send and receive a string (its
I'm trying to create an snippet from a paragraph. I have a long paragraph
I've been trying to create a new variable of type Cmplx (which is my

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.