Solved

illegal escape character .....

Posted on 2004-09-09
2
1,417 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

813 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now