From 502aa702600726638131f0e3025593ca750e7944 Mon Sep 17 00:00:00 2001 From: Kunal Shah Date: Sun, 14 May 2023 21:10:59 +0530 Subject: [PATCH] windows error fixed --- main.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index e24dc89..1f0ee7c 100644 --- a/main.cpp +++ b/main.cpp @@ -6,11 +6,12 @@ #include #include #include -#include #ifdef _WIN32 #include +#include #else #include +#include #endif using namespace std; @@ -101,9 +102,15 @@ class account cout << "\n\nSet Forgot Pin Question \nName of your First School ? :- "; getline(cin, fpin); +#ifdef _WIN32 + srand(time(NULL)); + AccountNumber = rand() % random + 1000000; +#else srand(time(NULL)); AccountNumber = rand() % random + 1; +#endif + do { file.seekg(0, ios::beg); @@ -119,8 +126,14 @@ class account if (found) { +#ifdef _WIN32 + srand(time(NULL)); + AccountNumber = rand() % random + 1000000; +#else srand(time(NULL)); AccountNumber = rand() % random + 1; + +#endif } } while (found); @@ -962,7 +975,11 @@ class account #endif cout << "Exporting Data File " << c << "%"; cout.flush(); +#ifdef _WIN32 + Sleep(25); +#else usleep(10000); +#endif } #ifdef _WIN32