It is because many people want to be perfect just at the start, but there is always room to improvement, but people don't accept that, so they don't want to be better than what they are already, so the don't revise themselves or anything.
Answer:
#include <iostream>
using namespace std;
int main()
{
float speed_in_km_per_hr = 60;
// Output table head
cout << "km/hr miles/hr." << endl;
for (int i = 0; i < 10; i++)
{
// Convert KM/hr to miles/hr
float speed_in_miles_per_hr = speed_in_km_per_hr * 0.6241;
// Output speeds
cout << speed_in_km_per_hr << " " << speed_in_miles_per_hr << endl;
// Increase by 5
speed_in_km_per_hr = speed_in_km_per_hr + 5;
}
return 0;
}
Explanation:
Certain ways exist to simplify the process of data sharing between programs.some of these ways are;
A) When there are two programs that are not running at the same time,then the pipes or the sockets won't be able to work as their buffers would not be able to hold large files because they are small.
Looking at this scenerio,shared memory can be used.
The Sysv IPC shared memory API, POSIX shared the memory API or rather files on a tmpfs system of files can actually be used for shared memory operations.
B) Another possible solution can be named file. Instead of using an unnamed and shell pipeline,a name pipeline them uses the file system.
However,it can be treated with the use of mkfifo() or mknod() commands and then two separate programs or also processes can as well access the pipe by making use of the name of the pipe.
But one process(program) can actually open the pipe but as a reader for reading purposes and the other for writing purposes as a writer.