H Hareth Jun 25, 2006 #1 string word = "cool"; in c# how do i do that in c++ i searched online and i was lost.....
C Carl Daniel [VC++ MVP] Jun 25, 2006 #2 Hareth said: string word = "cool"; in c# how do i do that in c++ Click to expand... I't s amuch more complex issue in C++ because there are many different kinds of strings: // C++ standard library #include <string> using namespace std; string word = "cool"; // "ASCII-Z string const char* word = "cool"; // MFC CString CString word = "cool"; // .NET String (compile with /clr) #import <System.Dll> using namespace System; String word = "cool"; .... etc. What do you want to do with the string? Are you writing .NET code, or native (unmanaged) code? -cd
Hareth said: string word = "cool"; in c# how do i do that in c++ Click to expand... I't s amuch more complex issue in C++ because there are many different kinds of strings: // C++ standard library #include <string> using namespace std; string word = "cool"; // "ASCII-Z string const char* word = "cool"; // MFC CString CString word = "cool"; // .NET String (compile with /clr) #import <System.Dll> using namespace System; String word = "cool"; .... etc. What do you want to do with the string? Are you writing .NET code, or native (unmanaged) code? -cd
H Hareth Jun 25, 2006 #3 "Carl Daniel [VC++ MVP]" <[email protected]> wrote in message i was planning to write a .net code.... thanks for yor help btw i was thinking of using ur example
"Carl Daniel [VC++ MVP]" <[email protected]> wrote in message i was planning to write a .net code.... thanks for yor help btw i was thinking of using ur example
E Egbert Nierop \(MVP for IIS\) Jun 25, 2006 #4 I believe you forgot a ^ managed pointer symbol String ^word = "cool"; And not to forget, my favorate string datatype, because (personally) I only work with C++ in a COM environment, the CComBSTR so CComBSTR word(L"cool"); or CComBSTR word; word = L"cool"; (since I modified the CComBSTR class, It has the same manipulation capabilities as CString); and there also is a Widestring variant (because Ascii is ooold); PWSTR word = L"cool";
I believe you forgot a ^ managed pointer symbol String ^word = "cool"; And not to forget, my favorate string datatype, because (personally) I only work with C++ in a COM environment, the CComBSTR so CComBSTR word(L"cool"); or CComBSTR word; word = L"cool"; (since I modified the CComBSTR class, It has the same manipulation capabilities as CString); and there also is a Widestring variant (because Ascii is ooold); PWSTR word = L"cool";
A Arnaud Debaene Jun 25, 2006 #5 Egbert Nierop (MVP for IIS) said: I believe you forgot a ^ managed pointer symbol String ^word = "cool"; Click to expand... No. He spoke about native std::string, not about managed System::String (mark the case difference). Arnaud MVP - VC
Egbert Nierop (MVP for IIS) said: I believe you forgot a ^ managed pointer symbol String ^word = "cool"; Click to expand... No. He spoke about native std::string, not about managed System::String (mark the case difference). Arnaud MVP - VC
E Egbert Nierop \(MVP for IIS\) Jun 25, 2006 #6 Arnaud Debaene said: Egbert Nierop (MVP for IIS) said: "Carl Daniel [VC++ MVP]" Hareth wrote: string word = "cool"; Click to expand... I believe you forgot a ^ managed pointer symbol String ^word = "cool"; Click to expand... No. He spoke about native std::string, not about managed System::String (mark the case difference). Arnaud MVP - VC Click to expand... gee, you're right. That also exists...
Arnaud Debaene said: Egbert Nierop (MVP for IIS) said: "Carl Daniel [VC++ MVP]" Hareth wrote: string word = "cool"; Click to expand... I believe you forgot a ^ managed pointer symbol String ^word = "cool"; Click to expand... No. He spoke about native std::string, not about managed System::String (mark the case difference). Arnaud MVP - VC Click to expand... gee, you're right. That also exists...
C Carl Daniel [VC++ MVP] Jun 25, 2006 #7 Arnaud said: Egbert Nierop (MVP for IIS) said: "Carl Daniel [VC++ MVP]" Hareth wrote: string word = "cool"; Click to expand... I believe you forgot a ^ managed pointer symbol String ^word = "cool"; Click to expand... No. He spoke about native std::string, not about managed System::String (mark the case difference). Click to expand... .... but I did miss the ^ on my managed String. -cd
Arnaud said: Egbert Nierop (MVP for IIS) said: "Carl Daniel [VC++ MVP]" Hareth wrote: string word = "cool"; Click to expand... I believe you forgot a ^ managed pointer symbol String ^word = "cool"; Click to expand... No. He spoke about native std::string, not about managed System::String (mark the case difference). Click to expand... .... but I did miss the ^ on my managed String. -cd