I have a simple C++ program I'm making for school.
I want to make it in VB now.
Can someone please convert my C++ code to VB. I would greatly appreciate it.
Thank you.
Code: Select all
#include <iostream>
using namespace std;
void ATOB(char a, int* dest)
{
int y;
for(y = 0; y < sizeof(char) * 8; y++)
printf("%c ", (a & (1 << y)) ? '1' : '0');
puts("");
}
char characterIn;
int characterOut[255];
bool run;
bool start;
int main()
{
start = true;
if (start)
{
cout << "Alpha to Binary Converter" << endl << "Read the binary digit from right to left." << endl
<< "Please enter a character to be converted to binary code:\n";
cin >> characterIn;
ATOB(characterIn, characterOut);
start = false;
run = true;
}
while (run)
{
cout << "Enter another character:\n";
cin >> characterIn;
ATOB(characterIn, characterOut);
}
system("PAUSE");
run = false;
return 1;
}