How can I implement the following C # code? Sample C ++ Code:
// перегруженный оператор ввода, для ввода значений массива с клавиатуры istream &operator>> (istream & input, Array &obj) { for (int ix = 0; ix < obj.size; ix++) input >> obj.ptr[ix]; // заполняем массив объекта obj return input; // позволяет множественный ввод, типа cin >> x >> y >> z >> ... }
public static возвращаемый_тип operator op(тип_параметра1 операнд1, тип_параметра2 операнд2) { // операции }..... all - Alexey Shimanskyistream. And idiomatic input does not occur with the<<operator, so you cannot enter an arbitrary type with<<. Tell us better what problem you are solving. - VladD