Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

Retrieving a string

i tried a simple c++ program:
i take a sample string:"c:\temp\work" and give this as an input.
i'd like to retrieve the string as such ,the problem  i face here is that i'm not able to get the same string as the characters adjacent to the backslash are deleted.
how to retrieve the string as such with the "\"?
0
LakshmiPrasad
Asked:
LakshmiPrasad
2 Solutions
 
akshayxxCommented:
r u trying this
char * c="c:\temp\work";

then its wrong .. u shud do like this

char * c="c:\\temp\\work";

0
 
akshayxxCommented:
since single back slash '\' is escape character .. to assign a backslash character in the string .. u shud use double back slashes "c:\\ddd\\ccc"
0
 
LakshmiPrasadAuthor Commented:
i do know that '\' is esc character ,but the thing is i'm taking "c:\temp\work" from a UI,now i need to manipulate the string which i had obtained ,but the string format gets changed and i'm not able to reproduce the same .
I'm able to avoid this for '\a','\b'...'\v'which form the escape sequences ,but if '\c' etc comes ,i'm not able to retrieve
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
SunBowCommented:
Read a single character at a time. In the input file, you can delineate a string by personal method, such as (1) 1st char is length of string or (2)all characters are part of string until a terminator is reached, such as cr, nl, tab, or special character such as semicolon or comma (see also, comma delimited files). Each character read in is appended to priors until string is completed.
0
 
akshayxxCommented:
u said u need to manipulate the string .. can u show how r u trying to manipulate.. as UI routines take care of the escape sequences ..
0
 
CleanupPingCommented:
LakshmiPrasad:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
akshayxxCommented:
to completely solve the problem , we needed asker's feedback.
split between SunBow and akshayxx for the contribution
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now