Solved

illegal escape character .....

Posted on 2004-09-09
2
1,432 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 200 total points
ID: 12023451
That stands true for Java as well.  (sorry I didn't pay closer attention the first time)

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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 …

726 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