serial numbers and databases

Sep 3, 2012 at 6:43am
Hi guys. i need to write C++ program that detects duplicate serial numbers when entered in an existing database.
i work with an energy auditing firm, am tasked with making sure no energy auditor under me fakes a serial number, at least not one that has already been entered.
Sep 3, 2012 at 7:08am
Use an std::set. The insert() function returns a pair<iterator,bool>, where the bool is false if the object already existed in the set.
Sep 3, 2012 at 7:44am
What kind of database is it?

Can't you just make the field unique?
Topic archived. No new replies allowed.