#include <iostream>
using namespace std;
class Cam {
int n;
public:
Cam(int x) { n = x; }
void print() { cout << n << endl; }
};
void func(Cam *c)
{
c->print();
delete c;
}
int main()
{
func(new Cam(1));
func(new Cam(2));
func(new Cam(3));
return 0;
}
[guest@localhost cpp]$ .iso++ t.cpp -o t
[guest@localhost cpp]$ ./t
1
2
3
[guest@localhost cpp]$