A
Anonymous
I am writing a test to try out OOP in C++. I am trying to get it to create
objects, then activate their functions in a specific order (the commented
section at the bottom). However, even without that section (which should be
ignored since it is commented out), I get errors:
ooptest.cpp:19: ISO C++ forbids defining types within return type
ooptest.cpp:19: return type specification for constructor invalid
ooptest.cpp:19: default argument given for parameter 5 of
`Vehicle::Vehicle(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, int, int = 200)'
ooptest.cpp:16: after previous specification in
`Vehicle::Vehicle(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, int, int = 200)'
What am I doing wrong?
Anonymous
objects, then activate their functions in a specific order (the commented
section at the bottom). However, even without that section (which should be
ignored since it is commented out), I get errors:
ooptest.cpp:19: ISO C++ forbids defining types within return type
ooptest.cpp:19: return type specification for constructor invalid
ooptest.cpp:19: default argument given for parameter 5 of
`Vehicle::Vehicle(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, int, int = 200)'
ooptest.cpp:16: after previous specification in
`Vehicle::Vehicle(std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, int, int = 200)'
What am I doing wrong?
Anonymous