String^

What is required to use a (String ^) [String hat] Object in a .cpp File?.
I use it simply without including any thing in a widnows form appication (Form.h[Design]). Visual Studio 2010 .


Name spaces or header files should be included , stuff like that ?


I think its a windows only thing.

So maybe windows.h

afaik Its System::string ^
It is in fact System::String, but it's a .net thing.

AFAIK you don't have to include anything. If you create a .net project in VS2010 it sets the right libraries in the project settings.

In your code you can add the namespace: using namespace System; or write System::String ^ foo.

I don't think you can use the .net class library in a plain Win32 or MFC project. But MFC brings its own CString class and for Win32 you can use string from the c-stdlib (include <string>). The include for CString from the MFC/ATL is either afxwin.h or atlstr.h.
That was very helpful .. Thanks so much
In standard C++ code, we would use std::string

For a tutorial, see: http://www.mochima.com/tutorials/strings.html
Topic archived. No new replies allowed.