Search:

Type: Posts; User: zzzaaahhh

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    42
    Views
    5,160

    Didn't know that. I've experienced that with C++...

    Didn't know that. I've experienced that with C++ names like cout or cin, but the GNU compiler has always let me use things out of <clibrary> (corresponding to <library.h>) without specifying the...
  2. Replies
    42
    Views
    5,160

    Yay, the board is working! Kudos to sang-drax,...

    Yay, the board is working!

    Kudos to sang-drax, for working SMART as opposed to hard! Congrats.

    quzah, C++ vs C actually did make a little difference in shaving some characters off:
    1) for...
  3. Thread: Pointers...

    by zzzaaahhh
    Replies
    9
    Views
    1,078

    The idea of when to use pointers with functions:...

    The idea of when to use pointers with functions:
    a) When you call a function and feed it variables as arguments, the function makes COPIES of the variables for its own use. So if you try to have...
  4. Replies
    2
    Views
    954

    Suppose that when you divide an integer n by a...

    Suppose that when you divide an integer n by a divisor d, you get the quotient q with remainder r: n = qd + r.

    Then the operations / and % will give the results: n/d == q, n%d == r. So, if n%d...
  5. Replies
    42
    Views
    5,160

    Ok, readability is not a criterion for the...

    Ok, readability is not a criterion for the contest. But if/when you do post the winners, can you ask the winners to decompress & comment them?

    Also, you didn't mention whether there would be any...
  6. Replies
    42
    Views
    5,160

    This looks like a cool contest! I hope you will...

    This looks like a cool contest! I hope you will post the winning programs, which should be very instructive. Related to which, can I suggest a slight change in the rules? For people to be able to...
  7. Replies
    4
    Views
    3,944

    The numerical recipes in C book...

    The numerical recipes in C book (http://www.nr.com) contains an extensive chapter on finding roots (chapter 9), with code for a variety of methods, as well as recommendations for shapes of curves...
  8. It works perfectly for me. In order to get it...

    It works perfectly for me. In order to get it to compile without warnings, I had to change the function prototype & definition to include void as sandman did, and include a return 0; at the end of...
  9. Replies
    10
    Views
    1,205

    I see this on XP and NT, IE6 & Netscape7. But...

    I see this on XP and NT, IE6 & Netscape7. But I've noticed that it goes away if I forbid any scripts to run.
  10. Replies
    7
    Views
    1,183

    One thing that's useful in these sorts of...

    One thing that's useful in these sorts of situations is to try to say in words what you would do to figure this out.

    You have successfully written code to get a (nonnegative) number from the user....
  11. Replies
    16
    Views
    1,788

    To be fair, he did apply code tags when told to,...

    To be fair, he did apply code tags when told to, and did reindent when told to. So it's not that he hasn't been listening. It's that he hasn't been understanding. And he hasn't been understanding...
  12. Replies
    10
    Views
    1,205

    Board format question

    At the top of the home page for each of the boards, there's a bar indicating how many pages of threads there are. Sometimes, the bar displays only 40 blocks. But at other times, it displays like...
  13. Rather than nested ifs, I think it will read...

    Rather than nested ifs, I think it will read easier to test yDiff1 and yDiff2 together. In other words, I think



    if (absyDiff1 < TINY) {
    if (absyDiff2 < TINY) {
    do something 1...
  14. Replies
    15
    Views
    1,893

    Just FYI on evaluating the factorial of...

    Just FYI on evaluating the factorial of nonintegral arguments: the factorial function is just a special case of the gamma function, which is studied in courses on complex analysis. The definition...
  15. Replies
    15
    Views
    2,787

    You could just declare two fixed arrays of large...

    You could just declare two fixed arrays of large enough size, like 100 cells each. That's not so expensive, and it more than exceeds the maximum row of Pascal's triangle that can be accurately...
  16. Thread: question

    by zzzaaahhh
    Replies
    4
    Views
    825

    The b is a variable. The code bonus b=10; ...

    The b is a variable. The code


    bonus b=10;

    is equivalent to



    bonus b; /* defines b as a variable, of type bonus */
  17. Replies
    15
    Views
    2,787

    Well, just calculate the row first, before...

    Well, just calculate the row first, before printing it out.

    You could have two arrays of int, oldrow & newrow.

    Initialize newrow with the first row of pascal's triangle, and initialize some...
  18. D'oh! Should have known it was failing to...

    D'oh! Should have known it was failing to ungetch something from the supposedly missing parentheses and carriage return. It works perfectly now. You guys are the best. Thanks!
  19. Some observations: What happens if yDiff2 and...

    Some observations:

    What happens if yDiff2 and yDiff1 are BOTH tiny? Say yDiff1 = 0.00014, yDiff2 = -0.00007. Then

    in the following code, |yDiff1-yDiff2| = 0.00021 > 0.0002, and you will not...
  20. Complex declarations & ?error in Kernighan/Ritchie?

    Hi, all. I am reading through the Kernighan/Ritchie 2nd edition of "The C Programming Language", and ran into trouble in chapter 5.12 (pp 123-125), where they write a program to translate complex...
  21. Replies
    24
    Views
    1,656

    This is not a programming answer, but more a...

    This is not a programming answer, but more a philosophy consideration--amount of time you've had the program is not the fairest cutoff for when to cutoff trial usage. If you download something, use...
  22. Replies
    23
    Views
    1,722

    That's a better explanation that what I gave...

    That's a better explanation that what I gave elad.

    But just in case it's not clear that your disagreement is with my explanation and not with stilwell's code, I do want to emphasize that the code...
  23. Replies
    23
    Views
    1,722

    You can certainly end with else if...

    You can certainly end with


    else if (y==10) r = 10;

    That's perfectly good code. The only reason I wrote


    else /* y==10 */ r=10; //the stuff in between /* */ is a comment
  24. Replies
    17
    Views
    2,261

    The basic idea of recursion is that you try to...

    The basic idea of recursion is that you try to break down a big problem into similar but smaller subproblems.
    In turn, each similar smaller subproblem is broken down into similar, even smaller...
  25. Replies
    23
    Views
    1,722

    That's a great observation--you don't even need a...

    That's a great observation--you don't even need a month variable, since you can just use 12*y for the number of months. That makes the "if" part even simpler.

    If you put all the output at the...
Results 1 to 25 of 26
Page 1 of 2 1 2