C# 指针操作相关
=========================================
// ** 取int 地址 以指针访问指向值 ** //
int size = Marshal.SizeOf(typeof(HLC2_OUT_DATA));
int* pInt = &size;
_syslog((*pInt).ToString());
// ** string 与IntPtr互转 ** //
string txt = "abce";
IntPtr pStr = Marshal.StringToCoTaskMemAnsi(txt); //分配内存,将string内容移入
string ss = Marshal.PtrToStringAnsi(pStr);
_syslog(ss);
//释放
Marshal.FreeHGlobal(pStr);
// ** char*与string互转 **/
string a = "11";
char* aChar = (char*)Marshal.StringToCoTaskMemAnsi(a).ToPointer(); //IntPtr To Char*
string s = Marshal.PtrToStringAnsi((IntPtr)aChar); //Char* To IntPtr
_syslog(s);
//** char* 与 IntPtr互转 **/
IntPtr intPtr = (IntPtr)aChar;
char* aChar1 = (char*)intPtr;