C#取C++函数指针的值

//pDataBuf 为一个返回的一个值,根据值拿到内存位置

 byte[] _rData = new byte[42];
                int _tag = 0;
                unsafe
                {
                    byte* pp = (byte*)pDataBuf;
                    byte[] buff = new byte[DataLength];
                    for (int i = 0; i < DataLength; i++)
                    {
                        while (pp[i] == 58)
                        {
                            _tag++;
                            for (int j = 0; j < 42; j++)
                            {
                                _rData[j] = pp[j];
                            }
                            break;
                        }
                        if (_tag > 0)
                        {
                            break;
                        }
                    }

posted @ 2012-02-06 15:50  bule  阅读(747)  评论(0编辑  收藏  举报