CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2013
    Posts
    21

    CString + CString

    How can I join two cstring


    C:\USERS\****\Desktop


    and

    \


    TO MAKE IT C:\USERS\****\Desktop\

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: CString + CString

    Did you read the CString documentation? It seems pretty obvious to me.

    http://msdn.microsoft.com/en-us/libr...=vs.60%29.aspx

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: CString + CString

    What have you tried?

  4. #4
    Join Date
    Jun 2013
    Posts
    21

    Re: CString + CString

    I tried

    Code:
    CString backlash = "\";
     CString whatever = m_path + backlash;
    it takes backlash as a new line though




    without adding the \ it will be a path that does not work

    example.. C:\Users\******\DesktopFile.cpp

    I need C:\Users\******\Desktop\File.cpp
    Last edited by vaas; July 1st, 2013 at 12:33 PM.

  5. #5
    Join Date
    Jun 2013
    Posts
    21

    Re: CString + CString

    for this error

    error C2001: newline in constant


    instead of using one \ I used \\ and it works now

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: CString + CString

    Quote Originally Posted by vaas View Post
    for this error

    error C2001: newline in constant


    instead of using one \ I used \\ and it works now
    Cool!
    Wasn't it a little detail to be clearly shown it in the OP?
    Or you simply want to test us about guessing Escape Sequences?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Jun 2013
    Posts
    21

    Re: CString + CString

    No, im not testing anyone..but I figured out the problem..and I was posting it ...maybe incase if someone has the same problem

  8. #8
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: CString + CString

    Quote Originally Posted by vaas View Post
    No, im not testing anyone..but I figured out the problem..and I was posting it ...maybe incase if someone has the same problem
    Well, then write a book.
    Or, a little bit better, learn first how to ask a question.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured