Re: unsafe?????????



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
.



Relevant Pages

  • Re: Hyphen is being replaced by question mark
    ... Word does not register the question mark and skips right ... standard place for a hyphen in Unicode. ... character to the Clipboard, open Ctrl-H again, and press Ctrl-V to put ...
    (microsoft.public.word.docmanagement)
  • Re: OT - Happy faces
    ... face character from the Windows Character Map it comes out as a? ... My Mac does not have the frownie, so I see a question mark there. ... your newsreader is too stupid to obey the UTF-8 headers. ...
    (alt.support.diabetes)
  • Re: OT - Happy faces
    ... character from the Windows Character Map it comes out as a? ... My Mac does not have the frownie, so I see a question mark there. ... your newsreader is too stupid to obey the UTF-8 headers. ...
    (alt.support.diabetes)
  • Re: Preserve trailing spaces in a textbox
    ... period, question mark, exclamation mark, dash, carriage return, ... a module-level boolean variable if the right-most character is a space. ... The trailing space should stay there if assigned ... A difficulty might be that if "Bob" is the last word in the field, ...
    (microsoft.public.access.formscoding)