I have a class Car that calculates speed and whatnot, but with the constructor im getting error messages bugging me to no end.
1 2 3 4 5 6
|
Car::Car(string carMake, int carYear)
{
make = carMake;
year = carYear;
setYear(year);
}
|
This is my constructor
Under the second 'Car' i get the message "no instance of overloaded function "Car::Car" matches the specified type.
later in my main() i have
Car carOne(make, year);
under 'make' i get the message "no instance of constructor "Car::Car" matches the argument list. Argument types are:(std::string, int)
Also when i try to build my project i get these messages
1>c:\users\kyle\documents\visual studio 2012\project\source.cpp(33): error C2511: 'Car::Car(std::string,int)' : overloaded member function not found in 'Car'
1> c:\users\kyle\documents\visual studio 2012\project\source.cpp(8) : see declaration of 'Car'
1>c:\users\kyle\documents\visual studio 2012\project\source.cpp(103): error C2661: 'Car::Car' : no overloaded function takes 2 arguments
Any ideas where i went wrong?