I tried my code in Visual studio and it doesn't give me an error, but when I tried my code on visual basic 6.0 c++ file (which should be the app required) , it gives me 2 errors
This is my code:
#include <iostream>
#include <string>
#include <limits>
int main()
{
std::cout << "CONVERSION\n\n";
std::cout << "Base 11 to Decimal\n";
char ans;
do
{
std::string s;
bool valid_input = false;
while ( !valid_input )
{
std::cout << "Base 11: ";
if ( !std::getline( std::cin, s ) ) break;
if ( !( valid_input = s.find_first_not_of( "0123456789aA" ) == std::string::npos ) )
{
std::cout << "Invalid Input\n\n";
}
}
if ( !valid_input )
{
std::cout << "See you later!" << std::endl;
break;
}
unsigned long value = std::stoul( s, nullptr, 11 );
std::cout << "Decimal: " << value << "\n\n";
std::cout << "Do you want to continue (Y/N)? ";
std::cin >> ans;
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
} while ( ans == 'y' && ans == 'Y' );
std::cout <<"Name:\tXXXXXXXX\n";
std::cout <<"Course:\tXXXXXXXX\n";
std::cout <<"Section:\tXXXXXXXX\n";
std::cout <<"Schedule:\tXXXXXXXX\n";
std::cout <<"Professor:\tXXXXXXXX\n";
return 0;
}
and these are the errors
Any alternative codes ? Codes in my brain are limited, Any help would be much appreciated!