Write a function to obtain a string with the binary representation of an integer
Respostas da entrevista
Sigiloso
28 de fev. de 2011
No one has handled the case for negative numbers.
We need to represent negative numbers in either 1s or 2s compliment
1
Sigiloso
19 de jan. de 2011
// it's caller's responsibility to delete the memory
char * conv_int_to_binary(int data)
{
int size = sizeof(data)*8;
char *binString = new char(size);
for ( int i = 0; i > i)&1;
}
return binString;
}