C++ Assignment Operator

This page answers questions like these:

How to Write an Assignment Operator in C++?

// Handles OBJECT1 = OBJECT2; where both objects are of type CLASS_NAME. CLASS_NAME& operator = (const CLASS_NAME& op2); // Handles OBJECT = string; (string is a standard C++ class) CLASS_NAME& operator = (const string& op2); // Handles OBJECT = char*; CLASS_NAME& operator = (const char* op2);
Related Links:
Difference Between char* and char [] and char s[n]
Difference Between char* s = string; and char s[] = string;
What is TCP Keep Alive?
How to Use TCP Keep Alive?
Static Member Function Declaration and Definition
Static Assertion / Compile-Time Assertion

Home  >  C++  >  C++ Assignment Operator


Tags: assignment operator, C++

Src: code-cpp-assignment-operator.txt
Dst: C++/assignment-operator.htm
Ads: 2