"Pointer" variable in VB?

in C/C++ there is a variable type as a "pointer" means it reference to any particular memory address, does VB has a "pointer" type variable

Answer this question

"Pointer" variable in VB?

  • RenX99

    Hi,

    The .Net framework forces your code to be encapsulated (oop approach) which means pointers are of no use. Well that's just quite idealistic, in reality we do need pointers, in C# we can declare a code as unsafe to be able to use pointers in C++ its default. Actually the word pointer is not that appropriate when you are referring to a managed language coz the memory locations of each object in the managed heap is frequently changed by the GC. In C++ the proper term for a "pointer" in a managed heap is a reference. But unfortunately references or pointers are not fully supported in the VB language...




    cheers,

    Paul June A. Domag


  • Luke R

    In .Net you use a Delegate and the AddressOf function which is the equivelent to a pointer in C++ more or less.

    You use it to point a variable or event to the memory address of a function.

    For a more detailed example search for Delegates

    Also this is a good article explaining pointers in .Net

    http://www.codeproject.com/dotnet/pointers.asp


  • Eugene Mayevski

    any variable can be a pointer...

    You would just create one.

    [code]
    Dim myVar As String

    myVar = me.txtTextbox.text
    [/code]

  • "Pointer" variable in VB?