----------
Thanks Salem.. i was guess i was thinking hex 40.. so dumb of me. Thanks for explaining.
Type: Posts; User: nappaji
----------
Thanks Salem.. i was guess i was thinking hex 40.. so dumb of me. Thanks for explaining.
unsigned int a = 40;
unsigned int mask = 1<<3;
unsigned int b = a | mask;
printf ("%d", b);
I have the above code and was expecting a result of 48 for b, but I get an output of 40.
if I use...
The classes dont have much in common, hence did not consider inheritance. Moreover only one of them will be used at any instance.
void * is to point to objects, not class.
thanks for the response.
yes, it will point to the object of the class.
i should have named it as "void * objptr;"
Yes, having the objects is one solution; or better have the pointers and...
I have a design related question.
Say I have 2 classes, class A and class B
I havea third class classMain, where I want to use wither classA or classB at runtime based on some parameters.
I am...
typedef struct stA
{
int a,b;
};
main()
{
stA elems[] = {{10,10},{20,20},{30,30}};
func(elems);
}
Here is a snippet of code;
I want to overload the [] operator such that, when I try to do something like
vCont[i]->name
it should check the mask against Contmask and take specific action.
...
Thanks Bench32 ; the first solution will work for me
In the code (.h file)below, I am creating a class clsA with a constructor.
Then, I am declaring another class clsB, which always will have 2 instances of clsA.
I am getting the C2061 error
...
Hello,
I am trying to divide a large binary number (54 bits) with another binary number (10 bits). Can some one please suggest what would be the fastest (in terms of execution speed) way to...
Hello,
I am trying to divide a large binary number (54 bits) with another binary number (10 bits). Can some one please suggest what would be the fastest (in terms of execution speed) way to...
i dont think so... i have been programming in C for the past few years and have always used a ".h" as a header extension.
Standard C headers are distinguished from user header files in the way...
Expert C Programming - Deep C Secrets by Peter Van der Linden is a very good book but not for beginners.
Can look complicated sometimes but very useful in getting a solid understanding...