Re: String Bug or somethig I missunderstood?

"Marsh, Drew" <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.general
Message-ID <[email protected]>
Miguel Ángel Chacón [mailto:[email protected]] wrote:

> Ok, but of which language are we talking about? I=B4m a 
> VB/Java/C++/C# programmer and my question is about how the 
> string(C#) should be terminated, I thought the zero was the 
> mark, but now I don=B4t = understand anything.=20
> 
> What is , then, the implementation of the string(C#)?

Are you familiar with COM BSTRs? It's basically the same thing. There is no
such thing as a terminator. The length of the string is stored separate from
the character buffer. So essentially speaking when the runtime reads from a
string, it assumes the char*+length is the string in memory, regardless of
what the values in the buffer are.

HTH,
Drew

[ .NET MVP | weblog: http://radio.weblogs.com/0104813/ ]

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.