HELLO c++ gurus, my name is andres and im here to ask for your help.
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
bool bermudas_or_coordinate() // true for bermudas, false for coordinates
{
cout << "Welcome to ANDRES’ hurricane distance/ time calculator, is the hurricane at Bermudas or at coordinates 16 64? ";
while (true)
{
string s;
cin >> ws; // skip any leading whitespace
getline( cin, s );
if (s.empty()) continue;
switch (toupper( s[ 0 ] ))
{
case 'B': return true;
case 'C': return false;
}
cout << "pleas type B for Bermudas or C for coordinates 16 64? ";
}
}
int main()
{
if (B_or_C())
cout << "the hurricane will reach its final destination of abc miles in abc hours!\n";
else
cout << "the hurricane will reach its final destination of 12345 miles in 12345 hours!\n";
return 0;
}
in the program above im finding an error c3861, i really cant figure this out by my self, help please!
It would be easier if you had posted the error message, but, anyway, c3861 means 'identifier not found'. I suppose that's ws you don't declare it anywhere. I guess it should be s. (line cin >> ws;). Also, function B_or_C() is not defined..
In the error message, compiler can't find 'bermudas_or_coordinates' . In you code, the function is called 'bermudas_or_coordinate' . If that's not it, then post your new code..