I'm currently refreshing myself with c++. I'm trying to write a program that converts a decimal input to a binary equivalent using an array. For some reason when the display console appears it doesn't display anything. Any suggestions?
Rich (BB code):
int x;
int i;
int tobinary[1];
cin >> x;
while(x/2 > 0)
{
tobinary = x % 2;
tobinary++;
}
cout << tobinary[0] << endl; //displaying 1 bit