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...

How to write a program for swapping two strings without
using 3rd variable and without using string functions.

Answer Posted / saptarshi

void main()
{
char *p="string1";
char *q="string2";

p^=q^=p^=q;
printf("%s,%s",p,q);
}

swapping the base pointers of the two strings may work...
if they are declared as character arrays, then it is not
possible as we cannot modify the value of array base
pointers...

Is This Answer Correct ?    10 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between fread and fwrite function?

1034


What are linker error?

1037


What is array in C

1100


Hai what is the different types of versions and their differences

1898


What are terms in math?

978


How do shell structures work?

1069


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

23595


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1954


Explain function?

1034


What is external variable in c?

1010


Describe the steps to insert data into a singly linked list.

1021


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2268


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1190


Write program to remove duplicate in an array?

1026


Can math operations be performed on a void pointer?

970