From: Jason H. <jas...@bt...> - 2001-12-05 19:32:14
|
When you refer to CString are you talking about a class of some kind or are you mixing up the C++ class String with a c "style" string? A c style string is in fact a null terminated string, and when you write "Hello World!" (note no need for \0) you are just declaring a null terminated string. If you are useing the C++ String class then to use it as a C string you have to use it's member function c_str(); which returns a pointer to a temporary c style string. Note that you shouldn't try to modify the string through this function. Regards, Jason. ----- Original Message ----- From: "Christian Wallukat" <Chr...@vo...> To: "CPP-Maillinglist (E-Mail)" <dev...@li...> Sent: Wednesday, December 05, 2001 3:09 PM Subject: [Dev-C++] (no subject) > Hi List, > > > I want to sent an UDP Datagram via TCP... > > The send and recive function works properly in a console app... > > Now i want to make a GUI for that... > > > > The problem is that the editfield in my application is a cstring (m_Edit1), > but my app needs a nullterminated string... > > If I convert the CString to a nullterminated string I get nothing ... > > If I write strcpy(szSendString, "hjsdfhs\0"); it works .... > > > > > I have many things tryed but nothing work... > > > Did you have an Idea ??? > > What can I do ? > > > > > Kind regrads > > > Christian > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |