python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Different order of adding same type objects causes an error
Could anyone explain why adding three objects like this a+(a+a) causes problems while a+a+a and (a+a)+a does not? The Foo class has one attribute num. Adding two Foo objects returns one with sum of th...
palestine_gaming
Votes: 0
Answers: 2
Error: invalid operands of types className<int>* and className<int>* to binary 'operator+'
I'm trying to make a class where I create a number based off of nodes linking to each other, allowing for larger integers. I overloaded the operator to allow individual nodes to add to each other as s...

Sean Zlatev
Votes: 0
Answers: 0
Virtual Equal Function on C++
I am trying to do something like:
class A
{
public:
A() = default;
~A() = default;
public:
bool operator==(const A& a)
{
return this->equal(a);
};
private:
vir...
Vero
Votes: 0
Answers: 1
C++ why operator overloading has to be inside Class?
In C++ I have:
class linked_list {
public:
node *head;
linked_list() : head(nullptr) {}
bool insert_node(int key) {
node *new_node = new node(key);
if (!new_node)
...
Robert
Votes: 0
Answers: 0