What is it that doesn't work?
1 2 3 4 5
|
int main()
{
GradeBook book("English", "Mr. Andrew");
book.displayMessage();
}
|
Welcome to the grade book for
English!
Being taught byMr. Andrew. |
I guess the output could look nicer but it is working.
Last edited on
Peter,
when I compile the program I get the following error:
1>------ Build started: Project: Chapter_3, Configuration: Debug Win32 ------
1>Compiling...
1>GradeBook.cpp
1>Linking...
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\Nadia\Documents\Visual Studio 2008\Projects\Chapter_3\Debug\Chapter_3.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Nadia\Documents\Visual Studio 2008\Projects\Chapter_3\Debug\BuildLog.htm"
1>Chapter_3 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So I am not sure why. Your output is what it is suppose to be produced.
Last edited on
I have gone over this constructor and I can't figure out why I am getting the error above.
Looks like it can't find the main function. Did you add a main function? If you use more than one .cpp file, did you link properly?
No, I haven't build the main function yet. I guess that is what is missing. Let me build it and see what happens.
Peter,
I feel like an idiot. The program works properly once I created the cpp file with the main in it.
Thanks!!!