Bug 406118 - \\n is not processed as \n when cout to the screen or printf to the screen
Summary: \\n is not processed as \n when cout to the screen or printf to the screen
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 8.1.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-19 14:21 EDT by andrew dolan CLA
Modified: 2020-09-04 15:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew dolan CLA 2013-04-19 14:21:19 EDT
Given this c++ code:

   cout << "Use \\n to cause a newline; use \\t to cause a tab." << '\n';
   cout << "Use \\a to cause a beep (only on some platforms)!";

AND

this c code:

   printf("Use \\n to cause a newline; use \\t to cause a tab. \n");
   printf("Use \\a to cause a beep (only on some platforms)! \n");

The compiler treats the \\n or \\t or \\a as just a \n or \t or \a instead of just treating that combination as two characters to be printed out.  This manifests itself in a debug run, and when run in command line.

\\ by itself does get printed as just \.  

Thanks for your help!
Comment 1 andrew dolan CLA 2013-04-19 14:22:55 EDT
I am using Juno as well.  We tried this code with just the command line gcc compiler and it worked fine.  I am using minGW as the compiler for this, so the gcc standalone test shows that it is most likely an eclipse problem.

Thanks!