Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Illegal escape characters error when compiling


  • Please log in to reply

#1
Metal God

Metal God

    Banned

  • Banned
  • PipPip
  • 49 posts
when i compile this java code, i get an error saying illegal escape characters, i have no idea what that means, but look :

mouse1.java:43: illegal escape character
File f = new File("C:\Documents and Settings\Charinthra Fonseka\Desktop\Record Take 26.wav");

there is a little arrow in the program that points to the second backslash in the "C:\...." address line. then the other errors are the same illegal escape characters error pointing to the rest of the backslash lines in the "C:\..." address.

thnx
  • 0

Advertisements


#2
ratmilk

ratmilk

    Member

  • Member
  • PipPipPip
  • 151 posts
In C++ you must escape the escape codes, so i assume its the same for java, it then becomes:
File f = new File("C:\\Documents and Settings\\Charinthra Fonseka\\Desktop\\Record Take 26.wav");

Its the escape code for a slash, for example \n is new line.
  • 0

#3
Metal God

Metal God

    Banned

  • Topic Starter
  • Banned
  • PipPip
  • 49 posts
it worked now, thnx a lot
  • 0

#4
ratmilk

ratmilk

    Member

  • Member
  • PipPipPip
  • 151 posts
No probs :tazz:
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP