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

Search:

Type: Posts; User: math8

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    569

    Re: virtual destructor

    Thanks, that makes sense
  2. Replies
    11
    Views
    569

    virtual destructor

    I know a virtual function is a member function of a class whose functionality can be overridden in its derived class.

    If you have a virtual statement, do you need to assign your destructor as a...
  3. Re: Coin/Money change code doesn't give exact change!

    alright, but aside from that, what is wrong with what I wrote before?
  4. Re: Coin/Money change code doesn't give exact change!

    hmmm, let see. Maybe something like:



    for(int i=0; i<=n/10;i++)
    {
    if((n-(i*10))%25 ==0)
    {
    x=i; //number of 10's
    z=(n-(i*10))/25 ; //number...
  5. Re: Coin/Money change code doesn't give exact change!

    I wasn't sure what you meant by "evenly". But first of, intuitively, for this problem to make sense , the "cents part" n must be either 0 or >=10 and at least n must be a multiple of 5 .
    So the only...
  6. Re: Coin/Money change code doesn't give exact change!

    when you say "evenly" do you mean by solving: 25x+10x=y, where y is the cents value?
  7. Replies
    2
    Views
    256

    stopping an infinite loop.

    The code below gives me the maximum odd number and the minimum even number of a list of numbers that the user type. However, for the loop to stop the user needs to type 1000. Is there a better way...
  8. Re: Coin/Money change code doesn't give exact change!

    I think the code is performing how it should, I think the problem is behind the logic (I guess that's the design). I am hoping to get 23 10's, one 5, two 1's ,2 quarters and 3 dimes.

    The logic...
  9. Re: Coin/Money change code doesn't give exact change!

    yeah, it should, my bad. Unfortunately, it doesn't.
  10. Coin/Money change code doesn't give exact change!

    My coin/money change code works when there can be an exact change each time, i.e. when the 1 cent option is available. However, when the change options are only $10, $5, $1, 25 cents and 10 cents, it...
  11. Re: calling another function within a function isnot working

    Never mind! found the error!! I needed to change the () into a [] in eKey(i), because eKey is not a function .
  12. calling another function within a function isnot working

    I have two functions bool check_key(string cKey, string eKey) and bool check_digit(char digit1, char digit2), and I have declared both of them globally (is this the right terminology?) right after...
  13. Replies
    2
    Views
    260

    Re: Adding two objects of class "Matrix"

    great, thanks!
  14. Replies
    2
    Views
    260

    Adding two objects of class "Matrix"

    I am trying to add matrices a and b. I am getting an error in the "add" function, probably because I have m[i] in it, and m is not an array. What is the correct way of writing the "add" member...
  15. Replies
    16
    Views
    506

    Re: I cannot print on an output file

    hmmm, I rearranged some things around, and this is what I came up with.


    #include<iostream>
    #include<fstream>

    using namespace std;
    ifstream file1;
    ofstream file2;
    void menu0();
  16. Replies
    16
    Views
    506

    Re: I cannot print on an output file

    Thanks, I will keep that in mind.

    However, I am running into this new problem: In the void Frequency function that I had , besides calculating the frequency, it was also calculating the number of...
  17. Replies
    16
    Views
    506

    Re: I cannot print on an output file

    Alright, I see what you are saying. But technically speaking, in my method, I write the same amount of text "cout<< / file2<<" - wise (except that I have 2 different but similar functions to call as...
  18. Replies
    16
    Views
    506

    Re: I cannot print on an output file

    Could you give me an example of a function of type double, float,or char that can return some text both for the screen and for the ouput file. I tried earlier, and I couldn't make it work, that's why...
  19. Replies
    16
    Views
    506

    Re: I cannot print on an output file

    I just figured out what was wrong.

    I cannot use the same function Frequency when printing out on the output file. I had to create a copy of the Frequency function and in the new one, I replaced...
  20. Replies
    16
    Views
    506

    Re: I cannot print on an output file

    Thanks, I can see it is an error. If I wanted to get the results of void Frequency(alphabet[p], num, a) on the screen, I would just write
    Frequency(alphabet[p], num, a) ; (with no cout<<). However,...
  21. Replies
    16
    Views
    506

    I cannot print on an output file

    So I am writing this code that analyzes a file called "analysis.txt" and prints out in an ouput file (called "report.txt") the results of the analysis, i.e.,(the frequency of all alphabet letters...
  22. Replies
    9
    Views
    486

    Re: Why can't I see the output of my C++ code?

    Thanks for the info, pretty scary in my opinion...
  23. Re: Shortcut for Commenting out a large block of code

    Thanks!
  24. Shortcut for Commenting out a large block of code

    Is there a quick shortcut (like CTRL+something) to comment out/ decomment a large block of code in Dev C++ when it is selected?

    I find it tedious to go line by line and add the // in front of...
  25. Replies
    7
    Views
    363

    Re: Revert a string code is not working

    I figured out what was wrong. 2 typos. i<=b/2 instead of i=b/2 and

    for(int i=0;i< counter-1;i++) instead of for(int i;i< counter-1;i++).

    Thanks!
Results 1 to 25 of 31
Page 1 of 2 1 2



HTML5 Development Center

Click Here to Expand Forum to Full Width