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

  • SEARCH
  • Home
  • 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 6362733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:56:50+00:00 2026-05-24T23:56:50+00:00

This is, I believe, a pedantic question. However since the FAQ does not seem

  • 0

This is, I believe, a pedantic question. However since the FAQ does not seem to disallow pedantry I’ll go ahead and ask since I am genuinely interested in the answer.

I’m trying to read and understand (most of) the C99 standard (ISO/IEC 9899:1999). I’m basically wondering whether this is strictly conforming code:

printf("String literal 1 "
"String literal 2.\n");

Or should the newline be escaped like this:

printf("String literal 1 "\
"String literal 2.\n");

The relevant section of the standard seems to be section 5.1.1.2, which describes the translation phases. In phase 2 each “\” followed by a newline is deleted, splicing the lines into one line. Then in phase 6, adjacent string literal tokens are concatenated.

So for the first code sample to be conforming I see two options: Either string literals separated by a newline are considered adjacent, or the newline characters are removed in one of the previous translation phases.

So does anyone know if the first code sample above can be considered strictly conforming in this context, and if so is there something in the standard that makes this absolutely clear?

  • 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-24T23:56:50+00:00Added an answer on May 24, 2026 at 11:56 pm

    I believe they are both strictly conforming. The \ is a different feature than string literal concatenation. So your first example is definitely fine: there is a new line character between the literals, which is a white space, and thus forms a “sequence of
    white-space characters” as mentioned in 5.1.1.3.

    The C standard in 5.1.1.2 is a bit unclear regarding the \ though, as it vaguely suggests that the new line character is removed as well as the backslash. But in this particular case it shouldn’t matter whether there are white space characters between the string literals or not, I believe that your first example will be interpreted as

    “String literal 1 “”String literal 2.\n”

    which in turn results in the expected output.

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

Sidebar

Related Questions

I believe this question is related to this one also, since I'm trying to
I believe this question might have been previously attempted in 2006 on a different
I believe this question applies to any of the For Html helpers, but my
I believe this question applies equally well to C# as to Java, because both
I believe this is a beginner's CSS question. I am utilizing the method described
I have been told and I'm not sure I believe this: Removing white space
I believe this may be a simple question, but I've looked everywhere and tried
I believe this works, I've tested it with multiple concurrent threads (though not exhaustively
I believe this question has been asked a lot of times, and I have
This doesn't seem to work in django 1.1 (I believe this will require a

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.