CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #4
    Join Date
    Feb 2017
    Posts
    674

    Re: What is the counterpart of this C pointer programme in C#?

    Quote Originally Posted by priyamtheone View Post
    Please clarify.
    One of the main goals of both Java and its follow-up C# is to be resilient to programmer errors. For this reason, you cannot do things like &i and *p. Explicit references and pointers were deemed dangerous and are not part of those languages. C++ takes another approach. You can still do it the C way, but you can also opt for a higher abstraction level to write safer code. In C++, you make this choice, not the language.

    Learn about classes and objects in C#, and you will understand how to rewrite your example program.
    Last edited by wolle; March 20th, 2021 at 04:52 AM.

Tags for this Thread

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

Featured