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 the meaning of typedef struct in c?

0 Answers  


write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word

1 Answers   Sienna Ecad, Wipro,


What are the features of the c language?

0 Answers  


Write a program to reverse a given number in c?

0 Answers  


how to print a statement in c without use of console statement ,with the help of if statement it should print

2 Answers   Satyam,






write a program of bubble sort using pointer?

3 Answers   TCS,


What is signed and unsigned?

0 Answers  


What is echo in c programming?

0 Answers  


Taking an example,differentiate b/w loader and linker ?

1 Answers  


What is the difference between local variable and global variable in c?

0 Answers  


how write a addtion of two single dimensional array using of pointer in c language?

3 Answers   DRDO,


errors in computer programmes are called

1 Answers   NET,


Categories