指针增量vb 2008 [英] pointers increment vb 2008

查看:51
本文介绍了指针增量vb 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我需要将指针增加一个,就像这样,i ++.

hi guys!

i need to increment a pointer by one, just like this, i++.

dim i as system.intptr



我该怎么办?

i + = 1无效.


帮帮忙! (好吧,gals也可以!同样可以请求!)



how do i do that?

i+=1 doesn''t works.


Help guys! ( well, gals can too! equally requested!)

推荐答案

这种类型没有指针算法!

这是很自然的:此类型假定数组元素没有大小,可以是任何形式,而不是指针运算没有意义的数组.

实际上,您不应以任何方式修改此类型的值.您可以改用数组,而System.Runtime.InteropServices.Marshal是您需要转到非托管类型并返回的方法.

对于一般的指针,它们仅在不安全模式下在.NET中可用.这是一个托管平台!

—SA
There is no pointer arithmetic on this type!

This is very natural: this type assumes no size of the array elements, it can be anything rather then array where the pointer arithmetic makes no sense.

Actually, you should not modify the value of this type in any way. You can use arrays instead and System.Runtime.InteropServices.Marshal is you need to go to unmanaged types and back.

As to pointers in general, they are available in .NET only in unsafe mode. This is a managed platform!

—SA


看看这篇文章:
探索元帅类的常规功能 [指针算术实用程序结构 [
Have a look at this article:
Exploring general functions of the Marshal class[^]

Also, have a look at this tip:
Pointer Arithmetic Utility Struct[^]

Good luck!


这篇关于指针增量vb 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆