Search:
Type: Posts; User: prestonprice57
Search:
Search took 0.10 seconds.
-
April 5th, 2011, 04:58 PM
Ohhhhhhhh. That makes so much sense! Can't use it cause its already in the library hahaha. Thanks!
-
April 5th, 2011, 04:15 PM
I am having trouble compiling my code in g++. It says "expected unqualified-id before delete"
Here is my code for the delete
template <class T>
class Node
{
public:
-
March 9th, 2011, 12:44 PM
Ahhhhhh! It worked. Thank you so much. :)
One asterisk has caused me so many problems! Thanks everyone for the help!
-
March 9th, 2011, 12:32 PM
Alright so then what exactly am I doing wrong? I'm confused again. If this is my transaction if statement:
else if (transactionType == 't')
{
in >> accountNumber;
in...
-
March 9th, 2011, 11:50 AM
Soooooo.......
account[accountNumber] = new &Loan(accountNumber, accountName,
initialBalance, theInterestRate);
?
-
March 9th, 2011, 11:41 AM
Alright that makes sense. But how do I dereference a pointer to an object? Cause right now I have,
account[accountNumber] = new Loan(accountNumber, accountName,
...
-
March 9th, 2011, 04:15 AM
Alright so I think it's just that my overloaded extraction operator isn't working with the pointer object. Is there a way I can get it to work?
-
March 9th, 2011, 01:27 AM
It works when I output a normal object but when I output the pointer it gets messed up. Is there a reason for this? Do I need to set the pointer object to something?
-
March 9th, 2011, 01:08 AM
Alright I have virtual functions that look like this:
double Account::addTransaction(double theTransactionAmount)
{
initialBalance += theTransactionAmount;
return initialBalance;
}
-
March 9th, 2011, 12:58 AM
Alright Awesome that worked! Now just one more problem (hopefully).
When I use cout in my transaction if statement, it outputs a bunch of hexadecimal numbers. Why does it do this? And I have the <<...
-
March 8th, 2011, 10:36 PM
Alright so that whole deal worked. But I came across another problem. In my transaction if statement it says,
else if (transactionType == 't')
{
in >> accountNumber;
...
-
March 8th, 2011, 03:59 PM
Alright I'll try giving that a shot!
-
March 8th, 2011, 03:14 PM
Thanks that actually makes sense! Except when I set account[accountNumber] to new Savings how do I initialize Savings.
-
March 8th, 2011, 01:50 PM
Hey I have a project for school where I have to make a bank class program using classes. I have to make a base class named Account and then 3 derived classes, Checking, Savings, and Loan. The problem...
-
March 2nd, 2011, 12:44 AM
I have this code:
char colon1;
char colon2;
int hour;
int minute;
-
February 17th, 2011, 06:19 PM
Oh cool. Thank you. I just avoided looking dumb to my teacher by throwing in a this pointer in for no reason.
-
February 17th, 2011, 06:01 PM
I ended up just putting:
Time Time::operator + (Time time1)
{
time1.hour += this->hour;
time1.minute += this->minute;
return Time(time1);
}
-
February 17th, 2011, 05:49 PM
Oh okay. But how would I get time1 to add to time2. It would make more sense to me to pass in a time1 and time2 so I can simply add them but my teacher put it like this so I have to keep it. I put...
-
February 17th, 2011, 05:20 PM
Sorry I'm really knew to classes. It's my second semester in C++ but this whole object-oriented deal has me a little confused.
-
February 17th, 2011, 05:20 PM
It doesn't compile when I put that. Also I didn't know you can return a whole class like Time.
-
February 17th, 2011, 04:50 PM
I have an assignment where we have to overload operators. The teacher already wrote out the class definition and main for the program and I just have to write the class functions and make them work...
-
January 20th, 2011, 09:50 PM
Yeah I did that instead of doing the stringstream ss. It was just floatNum = atof(str.c_str()). Thanks Paul!
-
January 20th, 2011, 08:37 PM
-
January 20th, 2011, 07:58 PM
If I did this how would I see each character. Like if the input was 5.25% How would I read in each character and then set the % to a null character instead, like I did in the array. And then how...
-
January 20th, 2011, 07:26 PM
I have to make a mortgage amortization schedule program and it prompts for the loan amount, interest rate, and loan term. I read in the inputs as an array to check if the user put a percent sign on...
|
Click Here to Expand Forum to Full Width
|