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;
}



what is the purpose of the following code, and is there any problem with the code? void fn(long..

Answer / senthil

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

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Interview Questions

What is local and global variable in c?

0 Answers  


What is non linear data structure in c?

0 Answers  


write a program to display the frequency of each element in a given array in c language

1 Answers  


Calculate 1*2*3*____*n using recursive function??

0 Answers  


How many identifiers are there in c?

0 Answers  






List the different types of c tokens?

0 Answers  


What is bubble sort in c?

0 Answers  


What is Conio.h ?

2 Answers   TCS,


Dont ansi function prototypes render lint obsolete?

0 Answers  


logic for x=y^n

1 Answers   Delphi,


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

0 Answers  


How can a string be converted to a number?

0 Answers  


Categories