C# vs Delphi Round 1

このエントリーをはてなブックマークに追加
uses Windows; {$APPTYPE CONSOLE}
procedure Exec(const Cmd: PChar);
var SInfo: STARTUPINFO; PInfo: PROCESS_INFORMATION;
begin
 GetStartupInfo(SInfo);
 CreateProcess(nil, Cmd, nil, nil, False, 0, nil, nil, SInfo, PInfo);
 WaitForSingleObject(PInfo.hProcess, INFINITE);
end;
var F: Text;
begin
 Assign(F, 'b.pas'); Rewrite(F);
 Write(F, 'begin Write(''Hello World'') end.');
 Close(F);
 Exec('dcc32 -cc b.pas'); Exec('b.exe');
end.