#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #define INPUTPATH "D:\\Bolshakov41p\\Processes\\Files\\Input.txt" #define PATHDOTHA "D:\\Bolshakov41p\\Processes\\x64\\Debug\\Processes.exe" int main() { HANDLE InputFile; InputFile = CreateFileA(INPUTPATH, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); int n; double a, b, c; char buffer[256]; ReadFile(InputFile, buffer, 256, &n, NULL); CloseHandle(InputFile); sscanf(buffer, "%lf %lf %lf", &a, &b, &c); char cmdArgs[200]; snprintf(cmdArgs, sizeof(cmdArgs),"%lf %lf %lf",a, b, c); STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); if(!CreateProcessA("D:\\Bolshakov41p\\Processes\\x64\\Debug\\Processes.exe", cmdArgs, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { printf("Не удалось создать процесс. Код ошибки: %d.\n", GetLastError()); } WaitForSingleObject(pi.hProcess, INFINITE); DWORD childExitCode; GetExitCodeProcess(pi.hProcess, &childExitCode); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); }