I need help with this error?
molecule.cpp:31:7: error: qualified reference to 'mole' is a constructor name rather than a type wherever a constructor can be declared mole::mole(Atom1(), Atom2() ){
class mole {
private:
string name;
int proton;
int neutron;
int electron;
int valence;
public:
int mass();
mole();
mole(Atom, Atom);
mole(string);
mole(string,int,int,int);
};
mole::mole()
{
name="hydrogen";
proton=1;
neutron=0;
electron=1;
valence=1;
}
mole::mole(Atom1(), Atom2() ){
proton= Atom1.p + Atom2.p;
neutron=Atom1.n + Atom2.n;
electron=Atom1.e + Atom2.e;
}
In another file:
#include<iostream>
using namespace std;
class Atom {
private:
string name;
int proton;
int neutron;
int electron;
int valence;
public:
int mass();
Atom();
Atom(int,int,int);
Atom(string);
Atom(string,int,int,int);
};
Atom::Atom(){
name="hydrogen";
proton=1;
neutron=0;
electron=1;
valence=1;
}
Atom::Atom(int p, int n, int e){
proton=p;
neutron=n;
electron=e;
}
Atom::Atom(string n){
name=n;
}
Atom::Atom(string nm, int p, int n, int e){
name = nm;
proton=p;
neutron=n;
electron=e;
}
int Atom::mass(){
int mass = proton+neutron;
return mass;
}