What does this piece of c code do? [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I came across this piece of code, but am not able to entirely make sense of it:
(((x)[y] << 8) | (x)[(y)+1])
where x is a pointer to a const unsigned char and y is an integer.

It extracts the 16-bit big-endian value starting at index y from array x.

Related

Power of any number program in c language [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 days ago.
Improve this question
How can write a code for power of any number in c language in program I have given base & exponent using for loop then inside for loop define power=power*base &then print base, exponent

Is there any usage for ' * ' in C else than multiplication and pointer? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Is the any more use of *, but for pointers *p and multiplication a*b ? If yes what usage it has?
Yes, it's part of multi-line comment syntax /*insert comment here*/

How i use current system time to Genrate the random numbers in C [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i have to make my random function to generate through the current system time generate between 0 to 9
You can use the modulus operator:
milliseconds % 10;
See here: http://www.cprogramming.com/tutorial/modulus.html

What does ** mean in C language? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
could anyone explain me please what does this piece of code mean?
int **d= (int**)malloc((m+1)*sizeof(int));
What are those ** for the d and the (int) ? Are they someway related to pointers?
int** d; //pointer to a pointer to an integer

offsetof with char as second argument. Is it possible? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'd love to create some part dynamically. Would it be possible to use offsetof with string as a second argument? Something like:
offsetof( tic, "close.v");
Or can I convert char to member anyhow?
The offsetof construct is a compile time operation. It can't be used with anything that is generated dynamically.

Resources