ex02: add test
This commit is contained in:
parent
c49545d3ff
commit
cc70b96d30
@ -24,14 +24,39 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "Fill and get";
|
||||
std::cout << "Fill and get" << std::endl;
|
||||
{
|
||||
unsigned int size = 10;
|
||||
Array<int> t(size);
|
||||
for (unsigned int i = 0; i != size; i++)
|
||||
t[i] = i;
|
||||
for (unsigned int i = 0; i != size; i++)
|
||||
std::cout << i << std::endl;
|
||||
std::cout << t[i] << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
std::cout << "Copy and get" << std::endl;
|
||||
{
|
||||
unsigned int size = 10;
|
||||
Array<int> t(size);
|
||||
for (unsigned int i = 0; i != size; i++)
|
||||
t[i] = i;
|
||||
Array<int> b(t);
|
||||
for (unsigned int i = 0; i != size; i++)
|
||||
std::cout << b[i] << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
std::cout << "operator = and get" << std::endl;
|
||||
{
|
||||
unsigned int size = 10;
|
||||
Array<int> t(size);
|
||||
for (unsigned int i = 0; i != size; i++)
|
||||
t[i] = i;
|
||||
Array<int> b;
|
||||
b = t;
|
||||
for (unsigned int i = 0; i != size; i++)
|
||||
std::cout << b[i] << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user