Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assing the value

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to put the following path in a variable

like String str=C:\Documents and Settings\Administrator\Desktop

But its showing error.

Please help me how to solve this problem


Thanks
 
Henry Wong
author
Marshal
Pie
Posts: 20997
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably a good idea to use quotes around a string literal... And escape the backslashes too...

Henry
 
Lucas Franceschi
Ranch Hand
Posts: 106
Mac Mac OS X Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why dont you post us your error?

but, i probably think that its exactly what henry said...

try doing this



should work
 
Lucas Franceschi
Ranch Hand
Posts: 106
Mac Mac OS X Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, and you probably mean assign, when you say assing, right?

(UPD: i'm starting to go crazy, i'm typing non-sense things.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic