Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 14th, 2006, 01:10 AM
Registered User
 
Join Date: Jan 2006
Location: Singapore, Singapore, Singapore.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tanchonghui
Default A problem from Professional C++ by Solter,Kepler

Hi. Can anyone help with this?

I implemented the code found on p.29 - 41 of the book "Professional C++" by Solter and Kepler.

My C++ compiler gives the following error message when it's compiling Database:
__________________________________________________ ___________________
Employee& Database::getEmployee(string inFirstName, string inLastName)
        ^

Database.cpp(51): Warning 18: implied return of Records::Database::getEmployee at closing '}' does not return value

void Database::displayAll()
   ^

Database.cpp(64): Warning 18: implied return of Records::Database::getEmployee at closing '}' does not return value
__________________________________________________ ___________________

These were the first lines of the error message. There were a few more lines. I can't figure out what's wrong.

Any advise?

Will be greatly appreciated.

tanchonghui
Reply With Quote
  #2 (permalink)  
Old January 28th, 2006, 08:12 PM
Authorized User
 
Join Date: Oct 2004
Location: San Francisco, CA, .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It looks like your compiler is having issues with the fact that getEmployee() throws an exception on the last line and doesn't return a value. Since the exception is thrown, no return value should be necessary.

To get it to compile, you can add this as the last line of that method:

return mEmployees[0];

Note that that line will never actually be executed.

I'm curious to know what compiler/verison you're using...

----
Scott J. Kleper
Author, "Professional C++"
(Wrox, 2005)
Reply With Quote
  #3 (permalink)  
Old January 28th, 2006, 11:42 PM
Authorized User
 
Join Date: Nov 2005
Location: , , India.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

we need code to debug problem correctly

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with code to "Professional Java Data superea_net Java Databases 0 August 1st, 2006 07:07 AM
Professional PHP5 p25 Interface Problem mercury7 Beginning PHP 0 January 13th, 2006 03:18 AM
Professional ASP XMl Case study 3 problem ammo1981 Classic ASP XML 0 January 27th, 2004 10:09 AM
Professional C# rajivthakur Wrox Book Feedback 0 November 5th, 2003 07:05 PM



All times are GMT -4. The time now is 06:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.