This assignment is worth 10 points.
Make sure that the program produces explicit output describing what it is attempting to do. Use plenty of blank lines. You probably should use plenty of comments in your code as well. Remember the purpose is to demonstrate your ability to detect errors and use error reporting routines.
You should read the man page for getpriority/setpriority and for getpid. In addition the following code fragment should help.
pid_t mypid int myprio mypid = getpid(); // no checking this can not fail. // perhaps you might want to check this... myprio = getpriority(PRIO_PROCESS, mypid); cout << "The priority for process " << mypid << " is " << myprio << "." << endl;I will compile your code with the following flags, it should produce no errors or warnings.
-g -O3 -Wall -Wextra -Wuninitialized -pedantic -Wshadow -Weffc++ -std=c++14