Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    23

    Unanswered: CString to string

    Hello,
    here is my question. I am new to VC++, but not C++.
    I would like to pass a variable of type CString (VC++) to a string in (C++).
    I currently am saving the variable of type CString in a file. Then in my C++ code open the file and read it out as type string.
    Is there just some short conversion.

    CString s1;
    s1="hello";
    string s2;
    s2=s1;

    could you do this? If not then what?

    Thanks for the help,
    Ronald

    (oh, by the way, how do you put your pic in the site?)
    This message is a natural product made from recycled electrons. The slight
    variations in spelling and grammar enhance its individual character and
    beauty and in no way are to be considered flaws or defects.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Yas you can but.....

    CString s1;

    CString s2;

    s1="hello";
    string s2;
    s2=s1;

Posting Permissions

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