this
means pointer to the object, so *this
is an object. So you are returning an object ie, *this
returns a reference to the object.
Related Posts:
- lvalue required as left operand of assignment error when using C++
- Are the C++ & and * operators inverses in all contexts?
- how does the ampersand(&) sign work in c++?
- What’s the difference between char and char* in C++?
- When should I use the new keyword in C++?
- Meaning of *& and **& in C++
- What are the differences between a pointer variable and a reference variable in C++?
- Arrow operator (->) usage in C
- Return array in a function
- What does “dereferencing” a pointer mean?
- Regular cast vs. static_cast vs. dynamic_cast
- What is a smart pointer and when should I use one?
- What does “dereferencing” a pointer mean?
- What is a char*?
- What exactly is nullptr?
- How to fix a “invalid operands to binary expression” error?
- What is a dangling pointer?
- What does `*&` in a function declaration mean?
- (->) arrow operator and (.) dot operator , class pointer
- What is uintptr_t data type
- What is the difference between const int*, const int * const, and int const *?
- C++ – No matching member function for call to ‘push_back’
- What is uintptr_t data type
- What does int & mean
- What is the difference between const int*, const int * const, and int const *?
- Use of “this” keyword in C++
- Pointer to incomplete class type is not allowed
- Passing by reference in C
- Why does the arrow (->) operator in C exist?
- “Error: expression must have a pointer type” when using the “this” keyword
- Passing a 2D array to a C++ function
- Can’t resolve Error: indirection requires pointer operand (‘int’ invalid)
- How to create a dynamically-allocated array of const objects, but have values assigned to them?
- How to access the contents of a vector from a pointer to the vector in C++?
- “Error: expression must have a pointer type” when using the “this” keyword
- How to make an array with a dynamic size? General usage of dynamic arrays (maybe pointers too)?
- expression must have integral type
- What does int & mean
- C++: Expression must have a constant value when declaring array inside function
- Sorting Linked List C++ with pointers
- Delete 2D array C++
- Is the sizeof(some pointer) always equal to four?
- C++ Expression must have pointer-to-object type
- C++ strings and pointers
- initial value of reference to non-const must be an lvalue
- Typedef function pointer?
- How to initialize a vector of pointers
- How to printf a memory address in C
- What is the use of intptr_t?
- C++ – Assigning null to a std::string
- How to convert const char* to char* in C?
- error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
- Using C-string gives Warning: “Address of stack memory associated with local variable returned”
- Reference to non-static member function must be called
- Why use pointers?
- What’s the difference between * and & in C?
- Invalid type argument of -> C structs
- What does ** mean in C?
- C++ pass an array by reference
- Get size of pointer in C
- C: pointer to array of pointers to structures (allocation/deallocation issues)
- Function stoi not declared
- Casting a pointer to an int
- C++ Array of pointers: delete or delete []?
- Why should I use a pointer rather than the object itself?
- Function stoi not declared
- C++ correct way to return pointer to array from function
- Warning: comparison of distinct pointer types
- Initializing pointers in C++
- Difference between function arguments declared with & and * in C++
- Is C++ Array passed by reference or by pointer?
- Difference between the int * i and int** i
- set head to NULL (‘NULL’ : undeclared identifier)
- What is a `char*`?
- clearing a vector of pointers [duplicate]
- C – Error is “free(): invalid next size (normal) “
- C++ Swapping Pointers
- Initialization makes pointer from integer without a cast – C
- Array of Linked Lists C++
- Differences between unique_ptr and shared_ptr
- g++ ld: symbol(s) not found for architecture x86_64
- error: lvalue required as unary & operand
- What is use of c_str function In c++
- Is there a decent wait function in C++?
- Why would we call cin.clear() and cin.ignore() after reading input?
- Should I learn C before learning C++?
- Comparison with string literal results in unspecified behaviour?
- Read whole ASCII file into C++ std::string
- Reading getline from cin into a stringstream (C++)
- C++ int float casting
- gcc: undefined reference to
- “Field has incomplete type” error
- C++ Returning reference to local variable
- OpenMP set_num_threads() is not working
- What is a null-terminated string?
- Right Justifying output stream in C++
- Use of ‘const’ for function parameters
- What is the difference between the dot (.) operator and -> in C++?
- Different ways to deallocate an array – c++
- Getting the error floating point exception: 8