thanks for your reply...
is there any good link on C tricky questions?
Type: Posts; User: onebrother
thanks for your reply...
is there any good link on C tricky questions?
I have few structures, & I get different values for each structure's sizeof() operator in a 32-bit processor
struct test1{
int i;
int j;
char c;
}
I think you should have an assignment operator (=), that is missing here.
Please suggest any good book on bit programming, especially for low level programming (like device driver)
thanks
Onebrother
thanks for your comment. I think this is one of the standard way of declaring these arrays
I have my data structures, one array of pointers(outer array), which in turn(each entry) again points to an array of pointers. How can I declare the outer & inner arrays. Can I make it (outer one) a...
in that case(64 bit processor) should not we get 8 bytes for sizeof(int) also?
I have a simple code here
int i, *p;
printf("sizeof i =%d, size of pointer =%d", sizeof(int), sizeof(p));
I get 4 bytes for size of int & 8 bytes for size of pointer.
multiplying x by 3 using bit operation in general as you explained is
(x<<1) + x
But say if I want to multiply (x=) 3 by 5 then how this will work?
because left shifting 3 by 1 bit will...
thanks for your reply...
what is the equivalent bit operation if I want to divide a number
by 3, as right shift of a number by n bits is equivalent of dividing it by 2^n.
Hi
If I need to multiply a number by 2, I can left shift the number by 1 bit.
because shifting left by n bits on a signed or unsigned binary number
has the effect of multiplying it by 2^n (base...
Hi
Whenever we do the shift operation (left or right) how can we know
that the shift operation is an arithmetic or logical shift operation?
Can someone tell me about any url where I can get...
I came across a code segment in open source, its like
#define pthread_exit(x)\
do {\
dbg("[%x] pthread_exit(" #x ")\n", pthread_self());\
pthread_exit(x);\
} while(0)
Is there any API in Linux for changing the byte order of a 64 -bit (long long) variable?
Please comment....
thanks
well I got lot of answers, even befor eposting here. But I was looking for something, in depth reply (from programmer's perspective)...unfortunately I dint get it here...I myself will find out & will...
What is the difference between memcpy and memmove? Which is more
expensive & why?
plz comment on this...
thanks
Hi
Is there any method to restrict the enumerated variable in C to occupy only one byte? I am using gcc (GCC) versin 4.0.0...
please comment
thanks
it should be
gcc -lrt <filename>.c
Yes I have included <signal.h> also
Hi all
In my application I'm using timer_create() & timer_settime() functions of linux.
but while compiling it gives me undefined reference for these two functions. I think I need to include some...
Hi all
I have a structure
struct test {
union test1{
short int Version:4,
thanks for your valuable comment....
Hi All
prog 1:
int main(void)
{
int i;
int arr[3];
for(i=0;i<4;i++)
thanks for your repy....
I have a doubt regarding typedefs in C
lets take an example
typedef struct{
int i;
}test;
int main()