Q: Expected type got Element c++ Im trying to make a object / type that consists of an element of the periodic table. But when i try to use a vector of that object as a parameter, i get this error message expected a type, got 'Element'
here is my code so far:
#include <iostream>
#include <string>
#include <vector>

using namespace std;

Element(int AtomicNumm, string Symboll, string Namee, double Weightt, 
int Neutronss, int Protonss, string ElectronConfigg) {
    string Name = Namee;
    int AtomicNum = AtomicNumm;
    string Symbol = Symboll;
    double Weight = Weightt;
    int Neutrons = Neutronss;
    int Protons = Protonss;
    string ElectronConfig = ElectronConfigg;
}
string returnElement(vector<Element> vec, string input) { // error here
    if (input.size() == 2) {
        for (int i = 0; i < vec.length(); i++) {

        }
    }
    return "";
}

int main(int argc, char*argv[]) {
    vector<Element> PT;
    string userinput (argv[1]);

    return -1;
}

Also, im new to c++. If objects work completely differently here please let me know. (Coming from java)

A: That's because you haven't declared 'Element' in your program. Syntactically, it is close to definition of a constructor.
To make your program work, i guess you can do following modification to existing element:
class Element {
    // your definition of element Here:

    // also include default constructor without any implementation 
    Element() {}
};

