#include <string>
#include <iostream>
using namespace std;
/**
Reverse a sentence.
*/
class Sentence
{
public:
/**
Creates a Sentence object.
@param aPhrase a sentence to reverse.
*/
Sentence(string aPhrase);
/**
Reverses this sentence.
@return the reversed sentence
*/
string reverse();
private:
string phrase;
};
Sentence::Sentence(string aPhrase)
{
phrase = aPhrase;
}
string Sentence::reverse()
{
if (phrase != "")
{
string c = phrase.substr(0, 1);
string rest = phrase.substr(1, phrase.length() - 1);
Sentence tailSentence(rest);
phrase = tailSentence.reverse() + c;
}
return phrase;
}
int main()
{
Sentence greeting("Hello!");
cout << greeting.reverse() << "\n";
return 0;
}
This is the error
------ Build started: Project: HorstmannGraphics, Configuration: Debug Win32 ------
Linking...
ccc_msw.obj : error LNK2019: unresolved external symbol "int __cdecl ccc_win_main(void)" (?ccc_win_main@@YAHXZ) referenced in function "long __stdcall ccc_win_proc(struct HWND__ *,unsigned int,unsigned int,long)" (?ccc_win_proc@@YGJPAUHWND__@@IIJ@Z)
C:\Users\Jessica\Documents\Visual Studio 2008\Projects\HorstmannGraphics\Debug\HorstmannGraphics.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Users\Jessica\Documents\Visual Studio 2008\Projects\HorstmannGraphics\HorstmannGraphics\Debug\BuildLog.htm"
HorstmannGraphics - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm not sure what this means.

New Topic/Question
Reply




MultiQuote





|