Hey,
Thanks for responding... I tried your suggestions, both the int in the main() and making the pow a double, but neither seem to be working. I still get the same error.
Any ideas?
Also, what do you mean, the difference between '1' and 1?
Thanks for your help!
Here's the code:
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main ()
{
int count = 0, bin, sum;
char line[32] ;
cin >> noskipws >> line[0] ;
while ( line[count] != '\n' )
{
count ++ ;
cin >> line[count] ;
}
sum = 0;
for ( bin = count - 1; bin >= 0; bin -- )
{
sum = sum + (line[bin] * pow(2.0,bin));
}
cout << sum;
cout << endl ;
}