swap string c 2b 2b

Solutions on MaxInterview for swap string c 2b 2b by the best coders in the world

showing results for - "swap string c 2b 2b"
Alessandra
23 Apr 2018
1public static void swap(int x, int y, int[] arr) {
2  	int temp = arr[x];
3  	arr[x] = arr[y];
4  	arr[y] = temp;
5}
Florine
17 Feb 2019
1std::ostringstream strs;
2strs << dbl;
3std::string str = strs.str();
Maximilian
20 Sep 2018
1// swap strings
2#include <iostream>
3#include <string>
4
5main ()
6{
7  std::string buyer ("money");
8  std::string seller ("goods");
9
10  std::cout << "Before the swap, buyer has " << buyer;
11  std::cout << " and seller has " << seller << '\n';
12
13  seller.swap (buyer);
14
15  std::cout << " After the swap, buyer has " << buyer;
16  std::cout << " and seller has " << seller << '\n';
17
18  return 0;
19}
similar questions
queries leading to this page
swap string c 2b 2b