Cs609.... Assignment
Cs609.... Assignment
#include <iostream>
#include <windows.h>
struct ThreadData
HANDLE hSrcFile;
HANDLE hDestFile;
DWORD chunkSize:
int threadNum;
DWORD bytesCopied;
std:cout < "Thread "<< data->threadNum + 1<<" copied " << bytes
Written
int main() {
std::string srcFilePath;
std::string destFilePath;
int numThreads:
std::getline(std::cin, destFilePath):
tL.Júnald Qazi
NULL;
CloseHandle(hSrcFile):
return 1:;
if (GetFileSizeEx(hSrcFile, &fileSize) {
CloseHandle(hSrcFile):
CloseHandle(hDestFile ):
return I:
std::vector<std::thread> threads:
std::vector<ThreadData> threadData(numThreads);
offset.QuadPart - chunkSize,
WnAtSApp:T
for (auto&t:threads)
tjoin();
CONTACT ON WHATSAPP
+923074960034
DWORD totalBytesCopied = 0;
totalBytesCopied += data.bytesCopied;
CloseHandle(hSrcFile);
CloseHandle(hDestFile):
Return 0;
OUTPUT: