开发者

LPSTR (Char*) in .NET

开发者 https://www.devze.com 2022-12-27 21:52 出处:网络
How do you declare a char* i开发者_JAVA技巧n .NET?You don\'t. That\'s what System.String is for. If you need to interop with native DLL\'s, see this.

How do you declare a char* i开发者_JAVA技巧n .NET?


You don't. That's what System.String is for. If you need to interop with native DLL's, see this.


What exactly are you trying to do?

I didn't see your comment. I guess we posted at the same time. String, being a reference type, will be stored in the heap (the value). While the location where the string value is should be on stack. Although I am not too sure since string does not behave as a 100% reference type.

You can create pointers in .NET through unsafe code. Although one should do that with utmost care or else can end up with weird and unexpected errors.

0

精彩评论

暂无评论...
验证码 换一张
取 消