JavaScript is required to use Bungie.net

オフトピック

ランダムな議論の洪水に飛び込もう
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.

投稿言語:

 

マナーを守りましょう。投稿する前に、Bungie の行為規範を確認してください。 キャンセル 編集 ファイアチームを作る 投稿

トピック全体を表示
このコンテンツはご覧いただけません。
;
preload icon
preload icon
preload icon