bit structure (the way the int or number will be as bits:11000000...=3)

Hello everyone!

I have simple code here:
1
2
3
4
5
6
7
	unsigned char b = 0; int a, c;
	for( c = 0; c < 64; c++ )
	{
		b = c;
		cout << c << ":";
		for( a = 0; a < 8; a++ ) { if( b & (1<<a) ) cout << "1"; else cout << "0"; }; cout << endl;
	}


results:
0:00000000
1:10000000
2:01000000
3:11000000
4:00100000
5:10100000
6:01100000
7:11100000
8:00010000
9:10010000
...

My question is that, if i would run this code in other systems like for
example linux or mac, will i get the same result?

Thanks!
Last edited on
Yes.
awesome!
But what about xbox, ps4 and phones?
( they all work on binary system as i remembered )
Yes. It will work fine.
Topic archived. No new replies allowed.