I am doing an program of Employee Database in C++. I want to generate a Unique Employee Number for each Employee but I am not successful can someone help me and oh please post the code relevant to Turbo C++ Borland and not Visual C++. Hoping to hear from you guys soon. If not the code please tell me an algorithm to do this job.
Share
Start at 1 and increase each time. Here’s a single-threaded version:
For a thread-safe version, use an
std::atomic<unsigned long long int>instead, or add a mutex.