so simple but non-working
its the getch that wont work. is it different than on windows? why wont this **** work??
its the getch that wont work. is it different than on windows? why wont this **** work??
Code:
#include <iostream>
int main (int argc, char * const argv[]) {
// insert code here...
int x;
std::cout << "Enter a Number To be Converted to feet or inches.";
std::cin >> x;
std::cout << "Ok. Now type 1 for inches2feet or 2 for feet2inches.";
if(_getch()=='1')
{
std::cout << x*12;
}
if(_getch()=='2')
{
std::cout << x/12;
}
return 0;
}
Last edited by a moderator: