I have been trying to make this code work for some time now. I have had an issue geting a return from toBinary. I have all of the needed includes so do not worry about them. I am some what new to C++ and even to programing in general so some of this is above my understanding.
using namespace std;
int toBinary (string myString)
{
int outValue = 0;
//string myString = inData;
for (std::size_t i = 0; i < myString.size(); ++i)
{
//cout << bitset<8>(myString.c_str()[i]) << endl;
bitset<8>(myString.c_str()[i]) >> outValue;
return outValue;
}
}
int main ()
{
cout << toBinary("432423") << endl;
}