Link to home
Start Free TrialLog in
Avatar of Harry_Kewell
Harry_Kewell

asked on

How to make the similar thing to cin >> MyDataType of C++ ?

In C++, we can do:

CStudent s;
cin >> s;

(the operator >> overloaded)

How to make similar thing in C# ?

Thanks.
Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

You would need to write a constructor that gets string as a parameter, read a string from the console and then create the object passing the read string
Avatar of Harry_Kewell
Harry_Kewell

ASKER

Could you give more detail explanations ? Thanks.
ASKER CERTIFIED SOLUTION
Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial