|
-
March 19th, 2021, 01:56 PM
#4
Re: What is the counterpart of this C pointer programme in C#?
 Originally Posted by priyamtheone
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|