possibly: your ctor has 2 things, you provided 1.
dvc and DVC are not the same. College and college are not the same. Details matter here, don't approximate the code and the message, give us the real code and the real messages, preferably enough of the code to try to run it as a little stub program.
main.cpp:40:13: error: no matching constructor for initialization of 'College'
College DVC("Diablo Valley College");
^ ~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:8:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const char[22]' to 'const College' for 1st argument
class College {
^
main.cpp:8:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const char[22]' to 'College' for 1st argument
class College {
^
main.cpp:10:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
College(string collegeName, int initialNum)
^
1 error generated.
The compiler generates some implicit member functions. In this case the compiler has these:
1 2 3 4 5 6 7
class College {
public:
College(string, int);
College(const College&);
College(College&&);
// other stuff
};
You wrote College DVC("Diablo Valley College");
It has one argument: "Diablo Valley College", which has type constchar*
Does the list above have College(constchar*);? No.
There are no instructions to create College from constchar*.
You can't call College(string, int); with one argument, because it requires two arguments.
Two options:
* Add a constructor that does take one argument (for example College(string);)
or
* Add second parameter to the call. E.g. College DVC("Diablo Valley College", 9182645);