Hello, I am searching for the scrip which can provide me the bitwise concatenation of the two integer numbers. If anyone is having solution for it, then please solve my problem by replying me some solution.
Hello, I am searching for the scrip which can provide me the bitwise concatenation of the two integer numbers. If anyone is having solution for it, then please solve my problem by replying me some solution.
I have tried for the same but not able to get the solution for it. I have done following:
Code:short num; int num2; in hex (num2>> 8) -> 3 num.byteValue () -> 7b //I want to num2 = 37b x = (num2>> 8) | (num.byteValue ());
Hello, I think you need to make use of the code below which can provide you the concatenation in Integer. So, just make use of it and solve your problem.
Code:x = (x & 0xFF00) | (w1 & 0x00FF);
For the solution on this problem of your, you must make use of the code below. But it is designed in the C#.
Code:#include "Port.h" #include "BinaryConversion.h" # include "iostream.h" Port prt; long binary(long); void BinaryConversion::test() { long num,r; num=prt.GetToken_DecimalNo(); printf("Inside user code %d",num); r=binary(num); prt.Send(r); } long binary(long num) { long rndr; long re; while(num >1) { rndr = num%2; num = num / 2; re = re & rndr; } return(re); }
I am not having knowledge about the javascript. But, I know the c language. If you want to concetenation of integers in c then you make use of the code below:
Code:#include <stdio.h> int main() { int num = 45, num1=5, num2= 8; char chr[20]; sprintf(chr, "%d%d%d", num, num1, num2); puts(chr); return 0; }
You can make use of the code below :
OR you can also make use of the code as below:Code:x = (x & 0xFFFFFF00) | (w1 & 0x00FF);
Code:x = (x & (-1 << 8)) | (w1 & 0xFF);
Bookmarks