Re: unsafe?????????
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Sun, 17 Jun 2007 11:27:33 -0700
You might try spending a little more thought on your Subject: field for your posts, so that it better describes the question you have, as well as on the actual phrasing of your question in the post (for example, putting more than just the code and "error,why").
Also, the Typographical Conservancy phoned, and they want to know why the question mark population had a sudden decrease. I'll suggest that you can help them avoid becoming endangered by not using so many, especially since putting extra question marks in your post doesn't make the post any more likely to be answered.
Now, all that said:
On Sun, 17 Jun 2007 09:47:39 -0700, wmhnq <wmhnq@xxxxxxx> wrote:
public class A
{
unsafe char* pStr = (char*)0;
public unsafe void change()
{
*pStr = "fghijkl";//error,why??????
}
}
You are assigning a string reference to a character. You didn't post the compiler error, but I suspect it says exactly that: something about cannot convert a string to a character.
You might prefer this line of code:
pStr = "fghijkl";
That should work better.
Pete
.
- References:
- unsafe?????????
- From: wmhnq
- unsafe?????????
- Prev by Date: Re: Obtaining exclusive access to file / file lock
- Next by Date: Re: Version control
- Previous by thread: unsafe?????????
- Next by thread: Re: unsafe?????????
- Index(es):
Relevant Pages
|