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

Do you know the use of 'auto' keyword?

662


What is #pragma statements?

592


Who invented bcpl language?

705


What are the similarities between c and c++?

601


How a string is stored in c?

589






What is the use of define in c?

598


What is the full form of getch?

585


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2239


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

1653


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

1473


What are operators in c?

584


What is logical error?

605


What are structure members?

600


What do you mean by recursion in c?

629


Is linux written in c?

602