Yurttas/PL/OOL/Cplusplus/F/02/04/05/01/03/t.cpp

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 1998
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9 
10   date   : January 1, 1998.
11   author : Salih Yurttas.
12
13   t.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21template<class T>
22void swap(T& a,
23          T& b);
24
25template<class T>
26void t(T& a,
27       T& b) {
28  cout << "--> a : ";
29  cin >> a;
30
31  cout << endl;
32  cout << "a = " << a;
33  cout << endl;
34
35  cout << "--> b : ";
36  cin >> b;
37
38  cout << endl;
39  cout << "b = " << b;
40  cout << endl;
41
42  swap<T>(a, b);
43
44  cout << endl;
45
46  cout << endl;
47  cout << "a = " << a;
48  cout << endl;
49
50  cout << endl;
51  cout << "b = " << b;
52  cout << endl;
53}