diff options
author | crupest <crupest@outlook.com> | 2021-06-12 23:20:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-12 23:25:49 +0800 |
commit | 7f2f87f3f1cc00bd16d1d5552cc126e9aabc3531 (patch) | |
tree | f698e7730919bd6c7a0ea441ed66de971d11db97 /operating-system-experiment/ParallelCalculationDemo.cpp | |
parent | 0c1d400a5f3a93a245e579bbfa7aa251077eff26 (diff) | |
download | life-7f2f87f3f1cc00bd16d1d5552cc126e9aabc3531.tar.gz life-7f2f87f3f1cc00bd16d1d5552cc126e9aabc3531.tar.bz2 life-7f2f87f3f1cc00bd16d1d5552cc126e9aabc3531.zip |
...
Diffstat (limited to 'operating-system-experiment/ParallelCalculationDemo.cpp')
-rw-r--r-- | operating-system-experiment/ParallelCalculationDemo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/operating-system-experiment/ParallelCalculationDemo.cpp b/operating-system-experiment/ParallelCalculationDemo.cpp index 7340da8..0174c55 100644 --- a/operating-system-experiment/ParallelCalculationDemo.cpp +++ b/operating-system-experiment/ParallelCalculationDemo.cpp @@ -12,9 +12,11 @@ int main(int argc, char **argv) { thread_number = std::atoi(argv[1]); if (thread_number <= 0) { std::cerr << "Argument must be a positive integer.\n"; + return -1; } } else { std::cerr << "Too many arguments.\n"; + return -1; } std::cout << "Use " << thread_number << " threads to calculate sum of 1-" << N |