Compiling errors assistance

So I'm doing a school assignment that involves testing array classes. When I compiled with g++, I got these errors:


test_array.cpp: In member function ‘void Test_array::test_push_back()’:
test_array.cpp:9: error: void value not ignored as it ought to be
test_array.cpp: In member function ‘void Test_array::test_pop_back()’:
test_array.cpp:33: error: void value not ignored as it ought to be
test_array.cpp:41: error: argument of type ‘unsigned int (Array<int>::)()const’ does not match ‘int’
test_array.cpp:43: error: no matching function for call to ‘Array<int>::pop_back(int&)’
array.hpp:19: note: candidates are: void Array<generic>::pop_back() [with generic = int]
test_array.cpp:49: error: no matching function for call to ‘Array<int>::pop_back(int)’
array.hpp:19: note: candidates are: void Array<generic>::pop_back() [with generic = int]

Here are the lines that are before and after the errors
Line 7: Array<int>a;
Line 8: a.push_back (2)
Line 9: CPPUNIT_ASSERT(a.size()==0);
Line 10: CPPUNIT_ASSERT (a.max_size()== 20);

31: Array<int> b;
32: b.push_back (2)
33: CPPUNIT_ASSERT(b.size()==0);
34: CPPUNIT_ASSERT(b.max_size()==20);


41: for (int i=b.max_size; i>0; i--)
42: {
43: b.pop_back(i);
44: CPPUNIT_ASSERT(b.size()==i);
45: CPPUNIT_ASSERT(b[i]==i);
46: }
47: try
48: {
49: b.pop_back(0);
50: CPPUNIT_ASSERT (false);
Lines 8 and 32: Missing semicolons.
Line 41: Missing empty parameter list ("()").
Line 43 and 49: Your pop_back() doesn't take any parameters. Don't you find it humiliating that other people are telling you how to use your own interfaces?
Thanks.

And no I don't. I'm only a beginner.
Topic archived. No new replies allowed.