String to RWCString

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ManishaJiwane
    New Member
    • Dec 2007
    • 2

    String to RWCString

    Hi



    How can I convert String to RWCString in C++ program





    Manisha
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Pass it the location of the string.

    Comment

    • ManishaJiwane
      New Member
      • Dec 2007
      • 2

      #3
      Originally posted by sicarie
      Pass it the location of the string.

      http://www2.roguewave.com/support/do...rwcstring.html

      Hi


      I tried in this way :

      string str1="name";
      RWCstring value;
      value(str1);

      The above code is giveing error
      "Error: Could not find a match for RWCString::oper ator()(std::str ing )"

      I also intialised it the string RWCstring value(str1) , but is still not working

      please suggest me some way to do this.

      Comment

      • deepak samuel
        New Member
        • Jun 2012
        • 1

        #4
        Hello

        try the below

        string a = "hello";
        RWCString _s (a.c_str());

        Thx
        Deepak.

        Originally posted by ManishaJiwane
        Hi


        I tried in this way :

        string str1="name";
        RWCstring value;
        value(str1);

        The above code is giveing error
        "Error: Could not find a match for RWCString::oper ator()(std::str ing )"

        I also intialised it the string RWCstring value(str1) , but is still not working

        please suggest me some way to do this.

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          There is a constructor for RWCString that has an std::string& argument:

          Code:
          string str1="name";
          RWCstring value(str1);
          so this code should work.

          Comment

          Working...