Can we pass another argument in right shift or left shift operator ?
istream& operator<<(istream &is, node*&head){
print(head);
return is;
}
like in the above function if I want to pass another argument like n, to control the number of elements in a linked list. Is is possible to do it ? How to do that if possible ?
Operation Overloading
@Coding_Mamba
Left shift ( << ) and right shift ( >> ) are both binary operators. That is , both of them require exactly two operands or arguments to work on. You cannot give any more or less operands to them.
To get an idea , refer to this code - https://ide.codingblocks.com/s/136963