π How can I get keyboard inputs from user c++?
Hello, I just got into C++ basics and I would like to know how can I get user keyboard inputs, for example if a user presses F1 something happens, This is what I got so far but it's not working 
I'm getting nothing though, :/ it's really frustrating cus Idk what to do Q.Q! I opened every single link on google, nothing.. 

Code:
#include "stdafx.h";
#include <iostream>;
#include <windows.h>;
#include <sstream>;
main()
{
string something = "OFF";
int f1;
cout << something << endl;
cin >> f1;
if(f1 == GetAsyncKeyState(VK_F1))
something = "ON";
system("PAUSE");
return 0;
}
