How to Create a New Operator in C++ and How

C++ creating new operators and overloading the current ones

Operator overloading is limited to the existing set of C++ operators. It's operator overloading, not creation. You cannot make new operators like @, nor can you turn non-operator characters like ' into operators.

Can I make new operators in C++ that only work on an object of a specific class?

You can't make new operators. You can only repurpose existing ones.

...then with #define I change how the preprocessor processes the text...

You probably shouldn't be doing that. Stay away from the preprocessor. It's a tool of last resort.

Is it possible to create a new operator in c#?

No, it is not possible. You would need to create a method instead

How to create objects using new operator and use them using for loop

Once you get the i'th element, it is no longer a pointer. So

ob[i].display();


Related Topics



Leave a reply



Submit