what is the purpose of the following code, and is there any
problem with the code?

void fn(long* p1, long* p2)
{ register int x = *p1;
register int y = *p2;
x ^= y;
y ^= x;
x ^= y;
*p1 = x;
*p2 = y;
}

Answer Posted / senthil

exchanges "long data type" values referenced by pointers p1 and p2

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1481


Is null equal to 0 in sql?

644


4. main() { int c=- -2; printf("c=%d",c); }

1364


Can you please explain the difference between syntax vs logical error?

689


What is the use of ?

618






What is null in c?

596


What is the significance of an algorithm to C programming?

594


What 'lex' does?

712


What is bubble sort in c?

631


What is string length in c?

605


What is self-referential structure in c programming?

655


What does the error message "DGROUP exceeds 64K" mean?

723


Not all reserved words are written in lowercase. TRUE or FALSE?

719


What are the differences between Structures and Arrays?

603


Explain c preprocessor?

678