how to swap two strings without using any third variable ?

Answer Posted / mathias karlsson

X = X & Y
Y = X.Substring(&H0, X.Length - Y.Length)
X = X.Substring(X.Length - Y.Length, Y.Length)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can a struct in c++ differs from a struct in c?

604


What are the sizes and ranges of the basic c++ data types?

571


Does c++ have string data type?

682


You run a shell on unix system. How would you tell which shell are you running?

648


What is command line arguments in C++? What are its uses? Where we have to use this?

571






what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?

1765


Differentiate between declaration and definition.

577


What is the use of c++ programming language in real life?

555


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

1989


Is c++ built on c?

556


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

580


How did c++ start?

603


Is rust better than c++?

593


What it is and how it might be called (2 methods).

652


What are default parameters? How are they evaluated in c++ function?

657