For example:
[] * -> + - ++ -- = += -= & == < <= > >= !
The asterisk (*) operator dereferences a pointer and returns the value stored in the memory pointed to by the pointer.
The pointer operator is called a mouse. This is a small woodland rodent and the aparatus looks similar to one when it is wired to the computer.
pointer -> fieldname
Pointer is a variable that stores the address of another variable . So pointer basically stores the address of another variable and size of pointer can be evaluated by using sizeof operator.
int *ptr; PS: I don't know what do you mean by 'using address operator'
1. Member-of operator (.) 2. Pointer-to-member-of operator (.*) 3. Ternary condition operator (?:) 4. Scope resolution operator (::) 5. sizeof operator 6. typeid operator
In C we use & operator while giving address of some variable to some pointer variable. & operator is also used in scanf().
You can't physically delete memory, you can only delete a pointer to allocated memory, which subsequently releases the memory back to the system. The operator is delete, passing the pointer as the operand. If the pointer points to an array, then you must also use the index operator [] in front of the pointer name.int main(){// pointer to an int type with value 100int* ptr_int = new int(100);// ... use pointer ...// release the integerdelete ptr_int;// pointer to an array 100 int types (with undefined values)int* ptr_int_array = new int[100];// ... use array ...// release the arraydelete [] ptr_int_array;return(0);}
The this operator is not a c operator. It is a c++ keyword. It is equivalent to an r-value pointer to the current instance of an object. It is useful when resolving between object members and method parameters.
A pointer variable contains the address to some memory location. "Dereferencing" the pointer means getting the value stored at that memory location.
The only "special" operators in C++ are those that cannot be overloaded. That is; the dot member operator (.), pointer to member operator (.*), ternary conditional operator (:?), scope resolution operator (::), sizeof() and typeof().
When a constructor is invoked dynamically, the new operator allocates the required memory, initialises it according to the constructor, then returns a pointer to the allocation. The destructor is invoked by deleting the pointer. It wouldn't make any sense to return a pointer from a deletion.