-
December 28th, 2012, 04:53 PM
#1
String problem
Hi,
Can anyone explain why is this error?
-
December 29th, 2012, 08:06 AM
#2
Re: String problem
you can write
C:/users/MilosS/Desktop/seba/playboy
don't use "\" always use "/" it will work
thx
-
December 29th, 2012, 10:49 AM
#3
Re: String problem
aha, now it works. Thanx.
-
December 29th, 2012, 10:53 AM
#4
Re: String problem
-
December 29th, 2012, 11:27 AM
#5
Re: String problem
I get this 2 warnings when i run Eclipse. Why are they popping up and what can i do to fix it?
-
December 29th, 2012, 12:22 PM
#6
Re: String problem
try this is official website
http://wiki.eclipse.org/EGit/User_Guide
you will get complete guide here simply follow the steps.. hope it will work.
thx
-
December 30th, 2012, 04:04 AM
#7
Re: String problem
Originally Posted by flex567
Hi,
Can anyone explain why is this error?
Another way is using like this : "C:\\Users\\MilosS"
-
December 31st, 2012, 12:21 PM
#8
Re: String problem
C:/users/MilosS/Desktop/seba/playboy
don't use "\" always use "/" it will work
This is not quite true. In the case of a windows file path using '/' instead of '\' will work in other situations you may well need to use '\'.
The problem is as follows: in Java the "\" char is used to escape other characters to provide special meaning ie \t gives a tab char, \n a newline etc. So if you want to put an actual "\" in a string you have a to add a "\" to the front of it to tell the compiler to embed a "\" rather than treat it as an escape sequence. So your string would need to be: "C:\\users\\MilosS\\Desktop\\seba\\playboy".
-
January 3rd, 2013, 09:40 AM
#9
Re: String problem
Code:
for (int i = 0; i <= c_path_name.length-1; i++) {
if(c_path_name[i] == '\') {
c_path_name[i] = '/';
}
}
Can someone explain to me why this won't compile?
And what should I change in this code so it would compile.
Last edited by flex567; January 3rd, 2013 at 09:45 AM.
-
January 3rd, 2013, 10:52 AM
#10
Re: String problem
keang posted the answer already (see post #8)
-
January 4th, 2013, 03:19 AM
#11
Re: String problem
solved that problem with '\\'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|