We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've updated the c++ example 6 to include std library features (e.g., unique_ptr, auto, cout, ...) and added rudimentary error handling. For example:
unique_ptr
auto
cout
/*parser test for Ca(HCO3)2 (calcium bicarbonate)*/ auto cdtest = unique_ptr<compoundData>(CompoundParser("Ca(HCO3)2", &err)); if (cdtest) { cout << "Ca(HCO3)2 contains " << cdtest->nAtomsAll << " atoms, " << cdtest->nElements << " elements and has a molar mass of " << cdtest->molarMass << " g/mol" << endl; for (int i = 0; i < cdtest->nElements; i++) cout << " Element " << cdtest->Elements[i] << ": " << cdtest->massFractions[i] * 100.0 << "% and " << cdtest->nAtoms[i] << " atoms" << endl; } else throw errorstring(__LINE__, *err);
If you're interested I can upload and create a pull request.
The text was updated successfully, but these errors were encountered:
Yep that looks cool. Feel free to open a PR.
Thanks!
Sorry, something went wrong.
Closed in #139 and #144
No branches or pull requests
I've updated the c++ example 6 to include std library features (e.g.,
unique_ptr
,auto
,cout
, ...) and added rudimentary error handling. For example:If you're interested I can upload and create a pull request.
The text was updated successfully, but these errors were encountered: