[RESOLVED] std::string to System::String
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

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

  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 08: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....
    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds


    Article(s): Allocators (STL) Function Objects (STL)

  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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center