language: C++11 (gcc-4.7.2)
date: 264 days 22 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <array>
 
using namespace std;
 
class testClass
{
    std::array<int, 2> testArray;
 
    public:
        testClass();
        void func() const;
 
};
 
testClass::testClass()
{
testArray[0] = 1;
testArray[1] = 2;
}
 
void testClass::func() const
{
    for (int i = 0; i < 2; ++i)
        std::cout << testArray.at(i) << '\n' << testArray[i] << '\n';       
}
 
 
int main()
{
    testClass test;
    test.func();
return 0;
}