Compilation Problem w/ CR/LFs in Translated char strings

This is a discussion on Compilation Problem w/ CR/LFs in Translated char strings within the C Programming forums, part of the General Programming Boards category; With our old compiler we did not have a problem with carriage returns and line feed that were embedded in ...

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    1

    Question Compilation Problem w/ CR/LFs in Translated char strings

    With our old compiler we did not have a problem with carriage returns and line feed that were embedded in the translated char array.

    With our new compiler , we are encountering compilation errors when
    a CR is encountered within the char declaration.

    Is there a compilation flag / option that can be set to address this problem ???

    Here is an example of the problem of the translated char declaration to a different language and contains the embedded CR which causes the compilation error:

    static const char* test = "T|g
    RNTX";

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    If you want to embed a new-line in a string, you should use the newline character: ""T|g\nRNTX";

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Conversion Char To Char * Problem
    By ltanusaputra in forum Windows Programming
    Replies: 3
    Last Post: 03-01-2008, 01:06 PM
  2. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 11:36 AM
  3. Storing strings in 2d char arrays problem
    By rainmanddw in forum C++ Programming
    Replies: 5
    Last Post: 10-22-2003, 05:41 PM
  4. Strings are V important...
    By NANO in forum C++ Programming
    Replies: 15
    Last Post: 04-14-2002, 11:57 AM
  5. String Processing Problem
    By muffin in forum C Programming
    Replies: 0
    Last Post: 08-24-2001, 10:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21