What is the purpose of the following code?
Is there any problem with the code?
void send(int count, short *to, short *from) {
/* count > 0 assumed */
register n = (count + 7) / 8;
switch (count % 8)
{
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
}
while (--n > 0);
}
}
Answer / Nand Kishore
The given code, `void send(int count, short *to, short *from)`, is designed to copy a sequence of short integers from 'from' to 'to', ensuring that the number of elements copied does not exceed 'count'.nnThere is no apparent problem with the code, assuming that it is part of a larger program and used appropriately.nnThe code uses a register keyword for optimization purposes. This keyword tells the compiler to make the variable 'n' accessible in multiple instructions, potentially improving performance.
| Is This Answer Correct ? | 0 Yes | 0 No |
ABCDCBA ABC CBA AB BA A A
WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES
Explain the Difference between the New and Malloc keyword.
Write a C program to get the desired output. 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 . . . 1 n..............n 1 Note: n is a positive integer entered by the user.
main() { printf("hello%d",print("QUARK test?")); }
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
3. Program to print all possible substrings. ex: String S St Str Stri Strin String t tr tri trin tring r
how to write a cprogram yo get output in the form * *** ***** ******* ********* ******* ***** *** *
Write a program in c to print * * * * * *******
what is the output for this question: main() { int i=1; printf("%d%d%d",i,i++,++i); }
The __________ attribute is used to announce variables based on definitions of columns in a table?