Pointers in C# to make int array?

后端 未结 3 783
感情败类
感情败类 2021-01-12 02:20

The following C++ program compiles and runs as expected:

#include 

int main(int argc, char* argv[])
{
    int* test = new int[10];

    for (         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-12 02:57

    You need to learn the C# language. Although there are syntactic similarities to C/C++, it - like Java - has a very different approach.

    In C#, objects behave, by default, as references. That is, you don't have to specify pointer referencing (&) and dereferencing (*) syntax.

提交回复
热议问题