Results 1 to 40 of 42

Thread: Visual Basic vs. C#

Threaded View

  1. #34
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    739

    Re: Visual Basic vs. C#

    Quote Originally Posted by JuggaloBrotha View Post
    C# can use pointers directly, which vb.net cannot do. So I guess one could say c# is a little lower level than vb still, but it's all a moot point.
    Microsoft's c# 2005 Step by Step by John Sharp has a page or so about pointers in c and c++ explaining how they're used and the kind of problems they can cause if not used correctly.

    It then goes on to say:-

    Code:
    Reference Variables were added to c# to avoid all these problems.
    If you really want to, you can continue to use pointers in c# but you must
    mark your code as unsafe.
    
    It then shows a couple of examples of using the unsafe keyword.
    
    It then goes on to say ... unsafe code has a bearing on how memory is managed:
    objects created in unsafe code are said to be 'Unmanaged'.
    So I reckon what that is saying is that c# 'can' use pointers in similar syntax to c/c++ but you really shouldn't. You should use the same 'reference variables' just like you'd do in VB
    Last edited by IanS; Jun 14th, 2010 at 05:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width