CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    4

    [RESOLVED] std::string to System::String

    How do I do this I think I'm going mad.

    fstream input("Input.dat", ios::in);
    vector<string> list;
    char listc[512];

    while( input.getline(listc, 512) )
    list.push_back( listc );

    input.close();

    for(int i = 0; i < (int) list.size(); i++)
    {
    Process^ myProcess;
    myProcess->StartInfo->FileName = list[i];
    }
    Last edited by Airashby; January 5th, 2009 at 09:49 AM.

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: std::string to System::String

    Code:
    std::string s("Hello");
    System::String^ String = gcnew System::String(s.c_str());
    should work....

  3. #3
    Join Date
    Jan 2009
    Posts
    4

    Re: std::string to System::String

    Thank you that did the trick.

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