Code:
exercise2.cpp:17:19: error: C++ requires a type specifier for all declarations
void read_ages(&name, n) // member function
^
exercise2.cpp:17:25: error: unknown type name 'n'
void read_ages(&name, n) // member function
^
exercise2.cpp:20:25: error: use of undeclared identifier 'n'
names_vec.push_back(n);
^
exercise2.cpp:21:43: error: use of undeclared identifier 'n'
cout << "Please enter an age for " << n << endl;
^
exercise2.cpp:40:21: error: invalid operands to binary expression ('std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') and 'int')
while(object.name != 'e')
~~~~~~~~~~~ ^ ~~~
/usr/include/c++/v1/system_error:606:1: note: candidate function not viable: no known conversion from 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') to 'const std::__1::error_code' for 1st argument
operator!=(const error_code& __x, const error_code& __y) _NOEXCEPT
^
/usr/include/c++/v1/system_error:611:1: note: candidate function not viable: no known conversion from 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') to 'const std::__1::error_code' for 1st argument
operator!=(const error_code& __x, const error_condition& __y) _NOEXCEPT
^
/usr/include/c++/v1/system_error:616:1: note: candidate function not viable: no known conversion from 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') to 'const std::__1::error_condition' for 1st argument
operator!=(const error_condition& __x, const error_code& __y) _NOEXCEPT
^
/usr/include/c++/v1/system_error:621:1: note: candidate function not viable: no known conversion from 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') to 'const std::__1::error_condition' for 1st argument
operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
^
/usr/include/c++/v1/utility:564:1: note: candidate template ignored: could not match 'pair' against 'basic_string'
operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
^
/usr/include/c++/v1/iterator:710:1: note: candidate template ignored: could not match 'reverse_iterator' against 'basic_string'
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
^
/usr/include/c++/v1/iterator:932:1: note: candidate template ignored: could not match 'istream_iterator' against 'basic_string'
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
^
/usr/include/c++/v1/iterator:1033:6: note: candidate template ignored: could not match 'istreambuf_iterator' against 'basic_string'
bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
^
/usr/include/c++/v1/iterator:1151:1: note: candidate template ignored: could not match 'move_iterator' against 'basic_string'
operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
^
/usr/include/c++/v1/iterator:1440:5: note: candidate template ignored: could not match '__wrap_iter' against 'basic_string'
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
^
/usr/include/c++/v1/iterator:1556:1: note: candidate template ignored: could not match '__wrap_iter' against 'basic_string'
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
^
/usr/include/c++/v1/tuple:1152:1: note: candidate template ignored: could not match 'tuple' against 'basic_string'
operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
^
/usr/include/c++/v1/memory:1965:6: note: candidate template ignored: could not match 'allocator' against 'basic_string'
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
^
/usr/include/c++/v1/memory:2915:1: note: candidate template ignored: could not match 'unique_ptr' against 'basic_string'
operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x == __y);}
^
/usr/include/c++/v1/memory:2962:1: note: candidate template ignored: could not match 'unique_ptr' against 'basic_string'
operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
^
/usr/include/c++/v1/memory:2970:1: note: candidate template ignored: could not match 'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against 'char'
operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
^
/usr/include/c++/v1/memory:4750:1: note: candidate template ignored: could not match 'shared_ptr' against 'basic_string'
operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
^
/usr/include/c++/v1/memory:4807:1: note: candidate template ignored: could not match 'shared_ptr' against 'basic_string'
operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
/usr/include/c++/v1/memory:4815:1: note: candidate template ignored: could not match 'shared_ptr<type-parameter-0-0>' against 'char'
operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
^
/usr/include/c++/v1/string_view:640:6: note: candidate template ignored: could not match 'basic_string_view' against 'basic_string'
bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
^
/usr/include/c++/v1/string_view:649:6: note: candidate template ignored: could not match 'basic_string_view' against 'basic_string'
bool operator!=(basic_string_view<_CharT, _Traits> __lhs,
^
/usr/include/c++/v1/string_view:659:6: note: candidate template ignored: could not match 'basic_string_view<type-parameter-0-0, type-parameter-0-1>' against 'char'
bool operator!=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
^
/usr/include/c++/v1/string:540:6: note: candidate template ignored: could not match 'fpos' against 'basic_string'
bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)
^
/usr/include/c++/v1/string:3621:1: note: candidate template ignored: could not match 'basic_string<type-parameter-0-0, type-parameter-0-1, type-parameter-0-2>' against 'char'
operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
^
/usr/include/c++/v1/string:3630:1: note: candidate template ignored: could not match 'const _CharT *' against 'std::__1::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >')
operator!=(const _CharT* __lhs,
^
/usr/include/c++/v1/string:3639:1: note: candidate template ignored: could not match 'const _CharT *' against 'char'
operator!=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
^
/usr/include/c++/v1/functional:1965:1: note: candidate template ignored: could not match 'function' against 'basic_string'
operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;}
^
/usr/include/c++/v1/functional:1970:1: note: candidate template ignored: could not match 'function<type-parameter-0-0 (type-parameter-0-1...)>' against 'char'
operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}
^
/usr/include/c++/v1/list:2379:1: note: candidate template ignored: could not match 'list' against 'basic_string'
operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
^
/usr/include/c++/v1/forward_list:1673:6: note: candidate template ignored: could not match 'forward_list' against 'basic_string'
bool operator!=(const forward_list<_Tp, _Alloc>& __x,
^
/usr/include/c++/v1/vector:3318:1: note: candidate template ignored: could not match 'vector' against 'basic_string'
operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
^
/usr/include/c++/v1/unordered_map:1485:1: note: candidate template ignored: could not match 'unordered_map' against 'basic_string'
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
^
/usr/include/c++/v1/unordered_map:2035:1: note: candidate template ignored: could not match 'unordered_multimap' against 'basic_string'
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
^
/usr/include/c++/v1/array:241:1: note: candidate template ignored: could not match 'array' against 'basic_string'
operator!=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
^
/usr/include/c++/v1/deque:2860:1: note: candidate template ignored: could not match 'deque' against 'basic_string'
operator!=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
^
/usr/include/c++/v1/regex:4834:1: note: candidate template ignored: could not match 'sub_match' against 'basic_string'
operator!=(const sub_match<_BiIter>& __x, const sub_match<_BiIter>& __y)
^
/usr/include/c++/v1/regex:4883:1: note: candidate template ignored: could not match 'sub_match<type-parameter-0-0>' against 'char'
operator!=(const basic_string<typename iterator_traits<_BiIter>::value_type, _ST, _SA>& __x,
^
/usr/include/c++/v1/regex:4936:1: note: candidate template ignored: could not match 'sub_match' against 'basic_string'
operator!=(const sub_match<_BiIter>& __x,
^
/usr/include/c++/v1/regex:4989:1: note: candidate template ignored: could not match 'sub_match<type-parameter-0-0>' against 'char'
operator!=(typename iterator_traits<_BiIter>::value_type const* __x,
^
/usr/include/c++/v1/regex:5043:1: note: candidate template ignored: could not match 'sub_match' against 'basic_string'
operator!=(const sub_match<_BiIter>& __x,
^
/usr/include/c++/v1/regex:5098:1: note: candidate template ignored: could not match 'sub_match<type-parameter-0-0>' against 'char'
operator!=(typename iterator_traits<_BiIter>::value_type const& __x,
^
/usr/include/c++/v1/regex:5154:1: note: candidate template ignored: could not match 'sub_match' against 'basic_string'
operator!=(const sub_match<_BiIter>& __x,
^
/usr/include/c++/v1/regex:5527:1: note: candidate template ignored: could not match 'match_results' against 'basic_string'
operator!=(const match_results<_BidirectionalIterator, _Allocator>& __x,
^
/usr/include/c++/v1/random:2439:1: note: candidate template ignored: could not match 'mersenne_twister_engine' against 'basic_string'
operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
^
/usr/include/c++/v1/random:2763:1: note: candidate template ignored: could not match 'subtract_with_carry_engine' against 'basic_string'
operator!=(
^
/usr/include/c++/v1/random:2946:1: note: candidate template ignored: could not match 'discard_block_engine' against 'basic_string'
operator!=(const discard_block_engine<_Eng, _Pp, _Rp>& __x,
^
/usr/include/c++/v1/random:3198:1: note: candidate template ignored: could not match 'independent_bits_engine' against 'basic_string'
operator!=(
^
/usr/include/c++/v1/random:3430:1: note: candidate template ignored: could not match 'shuffle_order_engine' against 'basic_string'
operator!=(
^
5 errors generated.