CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: prestonprice57

Page 1 of 2 1 2

Search: Search took 0.10 seconds.

  1. Replies
    3
    Views
    522

    Re: g++ compilation problems

    Ohhhhhhhh. That makes so much sense! Can't use it cause its already in the library hahaha. Thanks!
  2. Replies
    3
    Views
    522

    g++ compilation problems

    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:
  3. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    Ahhhhhh! It worked. Thank you so much. :)

    One asterisk has caused me so many problems! Thanks everyone for the help!
  4. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    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...
  5. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    Soooooo.......



    account[accountNumber] = new &Loan(accountNumber, accountName,
    initialBalance, theInterestRate);


    ?
  6. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    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,
    ...
  7. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    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?
  8. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    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?
  9. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    Alright I have virtual functions that look like this:


    double Account::addTransaction(double theTransactionAmount)
    {
    initialBalance += theTransactionAmount;

    return initialBalance;
    }
  10. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    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 <<...
  11. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    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;
    ...
  12. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    Alright I'll try giving that a shot!
  13. Replies
    19
    Views
    1,557

    Re: Help with C++ project

    Thanks that actually makes sense! Except when I set account[accountNumber] to new Savings how do I initialize Savings.
  14. Replies
    19
    Views
    1,557

    Help with C++ project

    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...
  15. Replies
    0
    Views
    354

    Help error checking

    I have this code:



    char colon1;
    char colon2;

    int hour;
    int minute;
  16. Replies
    15
    Views
    1,266

    Re: Question overloading operators

    Oh cool. Thank you. I just avoided looking dumb to my teacher by throwing in a this pointer in for no reason.
  17. Replies
    15
    Views
    1,266

    Re: Question overloading operators

    I ended up just putting:


    Time Time::operator + (Time time1)
    {
    time1.hour += this->hour;
    time1.minute += this->minute;

    return Time(time1);
    }
  18. Replies
    15
    Views
    1,266

    Re: Question overloading operators

    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...
  19. Replies
    15
    Views
    1,266

    Re: Question overloading operators

    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.
  20. Replies
    15
    Views
    1,266

    Re: Question overloading operators

    It doesn't compile when I put that. Also I didn't know you can return a whole class like Time.
  21. Replies
    15
    Views
    1,266

    Question overloading operators

    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...
  22. Replies
    6
    Views
    700

    Re: Help with an array problem?

    Yeah I did that instead of doing the stringstream ss. It was just floatNum = atof(str.c_str()). Thanks Paul!
  23. Replies
    6
    Views
    700

    Re: Help with an array problem?

    Alright thank you. :)
  24. Replies
    6
    Views
    700

    Re: Help with an array problem?

    If I did this how would I see each character. Like if the input was 5.25&#37; 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...
  25. Replies
    6
    Views
    700

    Help with an array problem?

    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...
Results 1 to 25 of 37
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured