We were talking today, in Intro to Programming, about machine language. I know it's a bunch of 0's and 1's. Let's say I compile the following C++ program on an x86 machine:
#include <string>
#include <iostream>
using namespace std;
int main()
{
cout << "Enter something";
string input;
cin >> input;
return 0;
}
Now, cin - as I understand - is an input stream. The computer gets input from the keyboard and places it in cin to be read by the program. My question is, how does the CPU know it's supposed to get input from the keyboard when, at the end of the day, the program is just 1's and 0's?
My understanding is that the machine code is kind of broken up.