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
A C++ Implementation That Detects Undefined Behavior
Fast Cross-Platform C/C++ Image Processing Libraries
Narrowing Conversions in C++0X. Is It Just Me, or Does This Sound Like a Breaking Change
Are There Practical Uses for Dynamic-Casting to Void Pointer
Why Cannot a Non-Member Function Be Used for Overloading the Assignment Operator
Why Static Variable Needs to Be Explicitly Defined
Limiting Range of Value Types in C++
Why Is "Using Namespace X;" Not Allowed at Class/Struct Level
What Is the Default Value for C++ Class Members
Compiling a Static Executable with Cmake
Undefined Reference Error for Template Method
How to Escape a String for Use in Boost Regex
Tmp: How to Generalize a Cartesian Product of Vectors
How to Use Unique_Ptr for Pimpl
Why Is Memset() Incorrectly Initializing Int
What's a Use Case for Overloading Member Functions on Reference Qualifiers