20:2: error: 'Manufracter' does not name a type
In constructor 'Car::Car()':
25:21: error: 'strcpy' was not declared in this scope
In constructor 'Car::Car(char*, int)':
28:18: error: 'strcpy' was not declared in this scope
In member function 'void Car::assignValues()':
35:3: error: 'man' was not declared in this scope
In member function 'void Car::displayValues()':
58:3: error: 'man' was not declared in this scope
In constructor 'Manufracter::Manufracter()':
75:20: error: 'strcpy' was not declared in this scope
In constructor 'Manufracter::Manufracter(char*, char)':
79:17: error: 'strcpy' was not declared in this scope |
The error on line comes from the
Manufracter
struct not being before the
Car
struct. Try to avoid spelling errors too :+) Really each struct should be in it's own files (a .hpp and .cpp for each), and they should be classes and not have public data. Provide an interface to access the data.
Is there any reason why you are using char arrays and not std::string? They are much easier to deal with.
strcpy
needs an include file, google to see what it is, but prefer
std::string
in any case.
new
&
delete
aren't recommended either, the best thing is to use a STL container like
std::vector
and not worry about memory management at all. Otherwise consider using smart pointers - Google
std::unique_ptr
using namespace std;
is also not recommended, just put
std::
before each std thing - that's what the expert coders all do. Google that as well :+)
Good Luck !!