Website creationProgramOne day is full of dummies.
C ++ is almost forgotten to be clean.
In fact, these are some of the most basic things. Writing a program for a period of time suddenly discovers that these most basic things are the most interesting. ------ \\\\ (˙ <> ˙ )/------
Don't say that some people like this kind of virtual stuff. It's just like an inflatable doll --! Speechless .....
Displacement operator, as long as you are familiar with binary, you can operate it skillfully.
Int num = 1;
Num <= 10;
Console. writeline (Num );
Shifts 10 bits left (Binary bits), equivalent to the 10th power of 2
The output result is 1024.
The conversion method between binary and decimal:
Conversion between binary and decimal: // convert the byte array to a long integer (Binary to decimal) Static long byteartolong (byte [] bytes) {int [] Nums = {1,256,512,102, 4096,8192, 16384,32768, 65536,131072, 262144}; If (bytes. length> nums. length) throw new exception ("overflow"); long num = 0; For (INT I = 0; I <bytes. length; I ++) num + = (Bytes [I] * Nums [I]); Return num;} // convert a long integer to a byte array (decimal to binary) static byte [] numtobytear (long num) {ilist <byte> DATA = new list <byte> (); long dividend = num; int indx = 0; do {long Yu = dividend % 256; dividend/= 256; data. add (byte) Yu);} while (dividend> 0); indx = 0; byte [] bytes = new byte [data. count]; foreach (byte B in data) bytes [indx ++] = B; return bytes ;}
.