A while back (freshman year of high school) I asked a really good C++ programmer who was a junior to make a simple application to convert a string to binary. He gave me the following code sample:
void ToBinary(char* str)
{
char* tempstr;
int k = 0;
tempstr = new char[90];
while (str[k] != '\0')
{
itoa((int)str[k], tempstr, 2);
cout << "\n" << tempstr;
k++;
}
delete[] tempstr;
}
So I guess my question is how do I get an equivalent to the itoa function in C#? Or if there is not one how could I achieve the same effect?