JavaScript is required to use Bungie.net

Servicio de alertas
Hoy, Destiny 2 estará fuera de línea temporalmente debido a operaciones programadas de mantenimiento. Permanece atento a @BungieHelp para conocer las novedades.

Varios

Navega una corriente de discusiones aleatorias.
10/16/2013 9:53:38 PM
3

Anyone good at c++ and willing to help out?

I'm trying to write two functions (three including main) that together, will output the binary versions of numbers 0-10. It seems simple, but the problem is that one of the functions needs to grab each individual bit of a number (1-10, and 16 bits) and the other needs to put those bits together to form a string. The string contains the binary version of x, where x is any number 1-10. From the linked code.. To get the each bit of a number, I'm using the function int bits, which grabs the bits in order, and I'm trying to connect them with bitstring, but as you can see, I've got no clue how to do that. I'm working on that for loop too. Anyone have any ideas? Specifically, how I can put the 'bits' function inside of 'bitstring' and transform it into a string? Output is supposed to be: [spoiler] 0 is: 0000000000000000 1 is: 0000000000000001 2 is: 0000000000000010 3 is: 0000000000000011 4 is: 0000000000000100 5 is: 0000000000000101 6 is: 0000000000000110 7 is: 0000000000000111 8 is: 0000000000001000 9 is: 0000000000001001 10 is: 0000000000001010 [/spoiler] I'll clarify if anything is unclear too. Any help is appreciated.

Publicando en idioma:

 

Pórtate bien. Echa un vistazo a nuestro Código de conducta antes de publicar tu mensaje. Cancelar Editar Crear escuadra Publicar

No se te permite acceder a este contenido.
;
preload icon
preload icon
preload icon