This is really weird... I'm trying to put the values in a string manually with a zero first, the iBuffer (the char as binary in a long) works fine if I cout it, but if I output any of the multidimentional array sOutput2 (char sOutput2), it gives me a completely different value... I tried substituting manual changes for itoa, but that doesn't seem to be the problem...
For example... if I input 'a' into sOutput (not sOutput2), then send it off for binary conversion, the cout line ends up giving me something like
for (i = 0, iLength = strlen (sOutput); i<iLength; i++)
iBuffer = to_binary( int(sOutput[i]) );
if (iBuffer < 1000000) //check to see if there are 7 digits
sOutput2[i] = '0';
sOutput2[i] = char( (iBuffer%1000000)/100000 );
sOutput2[i] = char( (iBuffer%100000)/10000 );
sOutput2[i] = char( (iBuffer%10000)/1000 );
sOutput2[i] = char( (iBuffer%1000)/100 );
sOutput2[i] = char( (iBuffer%100)/10 );
sOutput2[i] = char( iBuffer%10 );
sOutput2[i] = '\0';
else if (iBuffer >= 1000000)
cout << iBuffer << endl << sOutput2 << endl;
or if I input '0'...
It does that if it is done manually or with itoa! And yes, those are actually smileys in the program, not : ).