?
Solved

illegal escape character .....

Posted on 2004-09-09
2
Medium Priority
?
1,435 Views
Last Modified: 2012-06-27

 Hi experts,

    I got an illegal escape character .....  

-------------------------------------------------------------
    reader = new BufferedReader(
         new FileReader( "C:\Documents and Settings\meow\My Documents\My Received Files\SessionTest\StockPrices.txt"));
--------------------------------------------------------------
   what does it mean by "illegal escape character" ..... and how to fix it ? many thanks !

 meow.
0
Comment
Question by:meow00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 12023420
In C and C++, backslash (\) is used as a lead-in for an escape sequence, like \n, \t, \r, etc.
If you want to include the backslash character itself in the string, you need to escape it ...
with another backslash:

   new FileReader( "C:\\Documents and Settings\\meow\\My Documents\\My Received Files\\SessionTest\\StockPrices.txt"));

0
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 800 total points
ID: 12023451
That stands true for Java as well.  (sorry I didn't pay closer attention the first time)

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question