pharaoh fortune slot
ExamNotes.net
Welcome, Guest. Please login or register.
November 23, 2017, 05:18:34 AM

Login with username, password and session length
* Home Help Search Login Register
+  ExamNotes.net
|-+  General discussions
| |-+  Programming Forum
| | |-+  C++ Throw question
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: C++ Throw question  (Read 3931 times)
mindmesh
Spit Fire
Hero Member
*****
Offline Offline

Posts: 1623

2


View Profile
« on: July 20, 2005, 01:30:32 PM »

I'm working out of a book trying to refresh myself on C++, and everytime I use one of their programs with throw I get an error that I am unable to interpret. Any ideas..

Files attached.
Logged

I take no responsibility for the offensive nature of this post.. If you take offense I am sorry, but honestly don't give a damn. All rights reserved!!
mindmesh
Spit Fire
Hero Member
*****
Offline Offline

Posts: 1623

2


View Profile
« Reply #1 on: July 20, 2005, 01:35:20 PM »

here is the header file.
Logged

I take no responsibility for the offensive nature of this post.. If you take offense I am sorry, but honestly don't give a damn. All rights reserved!!
mindmesh
Spit Fire
Hero Member
*****
Offline Offline

Posts: 1623

2


View Profile
« Reply #2 on: July 20, 2005, 01:41:27 PM »

here is the error message.
Logged

I take no responsibility for the offensive nature of this post.. If you take offense I am sorry, but honestly don't give a damn. All rights reserved!!
dmaftei
Senior Member
Hero Member
*****
Offline Offline

Posts: 2156

1


View Profile
« Reply #3 on: July 22, 2005, 05:09:40 PM »

1. You have a typo: 'dividionbyzero' (line 33 in the source file).

2. You need to call printmsg() on 'fe', not on 'f' (line 40 in source file).

3. You need default and copy constructors for your classes.

A suggestion: do NOT use using directives ('using namespace std'); use using declarations ('using std::cout'), or even better qualify names when you use them ('std::cout').
Logged

BSEE, MSCS
www.maftei.net
mindmesh
Spit Fire
Hero Member
*****
Offline Offline

Posts: 1623

2


View Profile
« Reply #4 on: July 24, 2005, 10:55:20 PM »

Quote
Originally posted by dmaftei
1. You have a typo: 'dividionbyzero' (line 33 in the source file).

2. You need to call printmsg() on 'fe', not on 'f' (line 40 in source file).

3. You need default and copy constructors for your classes.

A suggestion: do NOT use using directives ('using namespace std'); use using declarations ('using std::cout'), or even better qualify names when you use them ('std::cout').


The first two I am aware of and have fixed. The third one, however, I will need to look at.. Thanks for the help, dmaftei. I'll let you know how it works out..
Logged

I take no responsibility for the offensive nature of this post.. If you take offense I am sorry, but honestly don't give a damn. All rights reserved!!
mindmesh
Spit Fire
Hero Member
*****
Offline Offline

Posts: 1623

2


View Profile
« Reply #5 on: July 25, 2005, 05:44:42 PM »

I made the changes you had suggested. I think I did them correctly but here they are if you want to take a look.
Logged

I take no responsibility for the offensive nature of this post.. If you take offense I am sorry, but honestly don't give a damn. All rights reserved!!
mindmesh
Spit Fire
Hero Member
*****
Offline Offline

Posts: 1623

2


View Profile
« Reply #6 on: July 25, 2005, 05:46:54 PM »

here is the cpp file.
Logged

I take no responsibility for the offensive nature of this post.. If you take offense I am sorry, but honestly don't give a damn. All rights reserved!!
dmaftei
Senior Member
Hero Member
*****
Offline Offline

Posts: 2156

1


View Profile
« Reply #7 on: July 25, 2005, 06:00:11 PM »

Does it compile?  What compiler do you use?
Logged

BSEE, MSCS
www.maftei.net
Sexy Lexy
Time to be bad
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2050

2


View Profile
« Reply #8 on: July 25, 2005, 09:06:34 PM »

The dmaftei retarded compiler, it doesn't do what it should and cries like a b1tch with a skinned knee when it doesn't get it's way.

Oops, sorry.

:p
Logged

Stewie: "I say, Rupert, this paste is quite delicious. It's almost worth the bowel obstruction."
dmaftei
Senior Member
Hero Member
*****
Offline Offline

Posts: 2156

1


View Profile
« Reply #9 on: July 26, 2005, 01:18:32 AM »

Quote
Originally posted by Sexy Lexy
The dmaftei retarded compiler, it doesn't do what it should and cries like a b1tch with a skinned knee when it doesn't get it's way.

Oops, sorry.

:p

??
Logged

BSEE, MSCS
www.maftei.net
dmaftei
Senior Member
Hero Member
*****
Offline Offline

Posts: 2156

1


View Profile
« Reply #10 on: July 28, 2005, 07:43:10 AM »

Quote
Originally posted by mindmesh
here is the cpp file.

Feel free to PM me if you need more help; with Lexy around it will be hard to discuss.
Logged

BSEE, MSCS
www.maftei.net
dmaftei
Senior Member
Hero Member
*****
Offline Offline

Posts: 2156

1


View Profile
« Reply #11 on: July 28, 2005, 07:45:54 AM »

Quote
Originally posted by Sexy Lexy
The dmaftei retarded compiler, it doesn't do what it should and cries like a b1tch with a skinned knee when it doesn't get it's way.

Oops, sorry.

:p

What the hell is the matter with you Lexy, are you drunk or something?!
Logged

BSEE, MSCS
www.maftei.net
Farrell
Senior Member
Full Member
***
Offline Offline

Posts: 104

0


View Profile WWW
« Reply #12 on: August 04, 2005, 06:58:33 AM »

Quote
Originally posted by Sexy Lexy
The dmaftei retarded compiler, it doesn't do what it should and cries like a b1tch with a skinned knee when it doesn't get it's way.

Oops, sorry.

:p


Esxcuse me but what was that all about? D was offering to help here by asking some relevant questions and you give a vague nonsensical attack on hinm?
Logged

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!