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

Search:

Type: Posts; User: arij177

Search: Search took 0.02 seconds.

  1. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    Yah, I looked at both of those ways, just used the one that was visually simpler to my mind at the time :P. What is the actual benefit of doing it that way?
  2. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    Thank you w3rd, that makes sense now, I was trying something similar, but can't believe I overlooked how you did it. Cheers, and thanks for the patience.
  3. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    Yes I have a book that I am referring to atm, also, I need the provCode to be two letters, as one isn't sufficient to represent all the different provinces. Any ideas?
  4. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    My output with single quotes is:

    Constructor called.
    Sin # is 22252
    Federal tax rate is 0.21
    Prov tax = -5.09078e+063
  5. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    When I change my single quotes to doubles it gives me an error regardless:

    error C2446: '==' : no conversion from 'const char *' to 'int'
  6. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    Also did you keep provCode as a char? Or did you change that too?
  7. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    I am using Visual C++ 2005 Express, and can you paste exactly what you changed to get that output? Because for me it is not working whatsoever.
  8. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    Even if i make the province code 1 character it still gives me the same, wrong, output. Any idea why?
  9. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    Have narrowed it down further, the char in the if statement is messing it up, but I have no idea how to get around this, is there a way to cast it to a double?
  10. Replies
    16
    Views
    1,475

    Re: Class & Constructor Problem

    I changed my ProvTaxFunction to


    double ProvTaxFunction()
    {
    if(provCode == 'ON')
    {
    provTaxRate = 0.19;
    }
    if(provCode == 'BC')
  11. Replies
    16
    Views
    1,475

    Class & Constructor Problem

    Hey all, I am having a problem where my function ProvTaxFunction() doesn't output properly due to an if statement being needed. Any help is appreciated...


    class CTaxCalc
    {


    public:
    ...
  12. Replies
    5
    Views
    1,585

    Re: [Help]Pointers with Functions Problem!

    TY Zuk! Big help, <3
  13. Replies
    5
    Views
    1,585

    Re: [Help]Pointers with Functions Problem!

    Reverting back to what I had before:



    #include <iostream>

    using std::cout;
    using std::cin;
    using std::endl;
  14. Replies
    5
    Views
    1,585

    Re: [Help]Pointers with Functions Problem!

    Well, what I need this to do is :

    Take taxOne(or taxTwo depending on the income), and multiply it by 0.07&#37; to get the airTax value.
  15. Replies
    5
    Views
    1,585

    [Help]Pointers with Functions Problem!

    I keep getting this error on line 39, as well as some others.
    error C2296: '*' : illegal, left operand has type 'double (__cdecl *)(double *)'

    I have no idea how to fix it, it gives me the same...
  16. Replies
    6
    Views
    1,101

    Re: 2D Arrays with Pointers Question!

    I am doing it to what was asked of me, and had to use MAX_A and MAX_B, I would have preferred just using 3 and 4 but yeh. And I did get it to work fine with a few alterations, I am not very good with...
  17. Replies
    6
    Views
    1,101

    Re: 2D Arrays with Pointers Question!

    Solved it myself. Don't worry about posting long solutions etc.
  18. Replies
    6
    Views
    1,101

    Re: 2D Arrays with Pointers Question!

    It turns out that my array is only saving data to the last memory location, any ideas of a fix?
  19. Replies
    6
    Views
    1,101

    2D Arrays with Pointers Question!

    Hey all, I have made a 2D array that stores user input but I cannot get it to display properly, I have resorted to using pointers and it is not going any better. Here is what I have so far.

    ...
Results 1 to 19 of 19





Click Here to Expand Forum to Full Width

Featured