Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is a structure member in c?

1009


Why is python slower than c?

1095


How pointers are declared?

965


What is keyword in c?

1017


What are the data types present in c?

1168


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

2010


What are reserved words?

1117


What is structure padding and packing in c?

1076


What is bin sh c?

1046


Explain what does the function toupper() do?

1083


What is the c value paradox and how is it explained?

1062


Explain how can I write functions that take a variable number of arguments?

1086


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

1140


Why do some versions of toupper act strangely if given an upper-case letter?

1079


What is meant by realloc()?

1164