一段时间以来,我一直在研究Visual Basic .NET中的C样式指针。我遇到过http://support.microsoft.com/kb/199824?wa=wsignin1.0,但是我不知道这是正确的方法还是如何应用它。我已经在c语言中使用程序编写了一个简单的指针,并且我希望它在必要时将一行一行转换为带有注释的Visual Basic。这是C:
int main()
{
int *myNumber=3; //the * means it's a pointer
doubleIt(*myNumber); //we use the void, the * means it returns a value not address
printf("%d",myNumber); //we print the variable
return 0; //we terminate the function
}
void doubleIt(int input)
{
input*=2; //double the input
}
Run Code Online (Sandbox Code Playgroud)