Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

illegal escape character .....

Posted on 2004-09-09
2
Medium Priority
?
1,439 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
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…
Screencast - Getting to Know the Pipeline

610 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