Final answer:
b) When you want to override built-in operator, Non-member friend operator functions are mostly used when you want to override built-in operators to allow intuitive operations on user-defined types, such as allowing natural syntax for operations on a complex number class.
Step-by-step explanation:
Non-member friend operator functions are most commonly used b) When you want to override built-in operators. In C++ programming, for instance, overloading operators allows you to provide intuitive functionality to user-defined types that mimic the behavior of fundamental types.
This can be particularly useful when creating complex data structures that benefit from having a natural syntax for operations, such as arithmetic or comparison operations. For example, if you're designing a Complex Number class, you might want to allow addition using the '+' operator, which isn't natively understood by the language for your user-defined type.
Using non-member friend functions allows these operators to have access to the private and protected data of the class, but the primary use is to make the syntax of custom types more readable and closer to the conventional usage of built-in types in expressions.
Non-member friend operator functions would not be used to create entirely new operators, as the operators that can be overloaded are fixed by the language, nor are they specifically designed to simplify code readability, although that can be a beneficial side effect.