Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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