How can I convert the code from C++ to C#?

  c++

How can I rewrite this to C#?

#include <iostream>

using namespace std;

 

class Employee {

public:

              string first = "";

              string last = "";

};

 

void foo(Employee *x) {

                             x->first = "stacey"; // I would call "Mutable"

                             x = new Employee();

                             x->first = "jennifer"; // I would say real byref

              }

 

void main(char *args[]) {

                             Employee *a = new Employee();

                             a->first = "josh";

                             Employee *b = new Employee();

                             b->first = "bill";

                             foo(a);

                             cout << a.first << endl;

              }

};

Source: Windows Questions C++

LEAVE A COMMENT