I am a beginner, and appoligize for the simplicity of my question. I searched this forum, and this question appears to be unaddressed.
For simplicity's sake, condensed code is below. I am trying to reproduce the results I get in Linux when I complile and execute this code in DOS. For some reason, dos does not work well with my bitshift operand, and returns 0. The linux results, which I desire in DOS, produce 5090000.
My question is, how can I modify this code so that the windows results return 5090000? Thank you for taking the time to read this post and perhaps ponder this issue.
I am using linux's cc compiler, and Borland's Turbo C
Code:
void main()
{
int A = 5;
int B = 8;
int C = 9;
printf("(((A<<B)|C) << 16) = %X\n", (((A<<B)|C) << 16));
printf("A = %X\n", A);
printf("B = %X\n", B);
printf("C = %X\n", C);
}
Results in Linux:
(((A<<B)|C) << 16) = 5090000
A = 5
B = 8
C = 9
Results in DOS:
(((A<<B)|C) << 16) = 0
A = 5
B = 8
C = 9
For simplicity's sake, condensed code is below. I am trying to reproduce the results I get in Linux when I complile and execute this code in DOS. For some reason, dos does not work well with my bitshift operand, and returns 0. The linux results, which I desire in DOS, produce 5090000.
My question is, how can I modify this code so that the windows results return 5090000? Thank you for taking the time to read this post and perhaps ponder this issue.
I am using linux's cc compiler, and Borland's Turbo C
Code:
void main()
{
int A = 5;
int B = 8;
int C = 9;
printf("(((A<<B)|C) << 16) = %X\n", (((A<<B)|C) << 16));
printf("A = %X\n", A);
printf("B = %X\n", B);
printf("C = %X\n", C);
}
Results in Linux:
(((A<<B)|C) << 16) = 5090000
A = 5
B = 8
C = 9
Results in DOS:
(((A<<B)|C) << 16) = 0
A = 5
B = 8
C = 9