Solved

illegal escape character .....

Posted on 2004-09-09
2
1,403 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
Comment Utility
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
Comment Utility
That stands true for Java as well.  (sorry I didn't pay closer attention the first time)

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

728 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