Hello There,
I am having terrrible trouble getting my head round certain bits of C - namely compound operators.
I have been programming in BASIC since the early 80s and then moved on to Turbo Pascal in the late 80s, then coding in ASP/HTML / Visual BASIC since the mid 1990s.
I cam also tinker in Javascript, but have come acrosss a need to convert a program from C to Basic.
Most of it I have done, but there are one or two routines which I cannot get my head around, no matter how hard I try...
Can anyone shed any light ... I need to convert the following from C to VB / Basic.
long XCH;
int Xoptions;
void mybits (short bit); {
printf ( (XCH & (1L<<bit))!=0);
XCH |= (1L<<bit) );
XCH &=~ (1L<<bit );
}
void myoption (int option); {
Xoptions |= option;
Xoptions &=~ option;
XOptions ^= option;
}
I have looked around and I know voids are like subroutines which I am passing parameters through to (bit and option), and I know that I have two global variables set up (XCH and XOptions), but I cannot get my head around the compound operators ... I think SHL and SHR come into it somewhere ... can anyone point me in the right direction to understand the above by replying with a VB equivalent of the above statements?
Many thanks.
Steve.


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum