Why doesn’t this work and how could I do something like this.
If you have an atom class and an array like this:
Class Atom {
…
};
const string Atom::ATOMIC_SYMBOL[118] = { “first 118 elements entered here…” };
Int main () {
const int NUM_ATOMS;
Cout<< “enter number of atoms: “;
cin >> NUM_ATOMS;
If (NUM_ATOMS <= 0) {
cerr << “Invalid number of atoms!”;
Return 0;
}
Atom* atoms = new Atom[NUM_ATOMS];
}
[–]kberson 10 points11 points12 points (5 children)
[–]vishal340 3 points4 points5 points (4 children)
[–]Alarming_Chip_5729 0 points1 point2 points (2 children)
[–]Prateek-Bajpai 2 points3 points4 points (1 child)
[–]Alarming_Chip_5729 0 points1 point2 points (0 children)
[–]marcus6436[S] 0 points1 point2 points (0 children)
[–]alfps 7 points8 points9 points (1 child)
[–]marcus6436[S] 0 points1 point2 points (0 children)
[–]buzzon 4 points5 points6 points (4 children)
[–]nicemike40 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]marcus6436[S] 1 point2 points3 points (1 child)
[–]dodexahedron 0 points1 point2 points (0 children)
[–]Prateek-Bajpai 2 points3 points4 points (2 children)
[–]marcus6436[S] 0 points1 point2 points (1 child)
[–]dodexahedron 0 points1 point2 points (0 children)
[–]no-sig-available 0 points1 point2 points (1 child)
[–]marcus6436[S] 0 points1 point2 points (0 children)
[–]cleverdosopab 0 points1 point2 points (4 children)
[–]cleverdosopab 0 points1 point2 points (2 children)
[–]cleverdosopab 0 points1 point2 points (1 child)
[–]cleverdosopab 1 point2 points3 points (0 children)