Search:

Type: Posts; User: risby

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. What's all that business with variable min? It's...

    What's all that business with variable min? It's just confusing things.
    You need to put the smallest value from the rest of the array into the first position, then repeat for the second position,...
  2. Replies
    16
    Views
    16,020

    That works. Thanks all.

    That works. Thanks all.
  3. Replies
    16
    Views
    16,020

    Can I just ask why you posted this? It makes me...

    Can I just ask why you posted this? It makes me think I've done something wrong.

    And, btw, what has happened to Tek-Tips? It's been down for the last couple of hours.
  4. Replies
    16
    Views
    16,020

    That looks good. I've tried it and it works fine...

    That looks good. I've tried it and it works fine with stdin but fails to read anything from a file. I'll play around with it though, thanks.
  5. Replies
    16
    Views
    16,020

    defaulting ifstream variable to standard input

    Hi peeps

    Can anyone tell me what must be a fairly standard incantation?

    About a decade ago I wrote


    ifstream fin;

    if (NULL == inputStream)
  6. True, swgh, but of all the examples of famous...

    True, swgh, but of all the examples of famous mathematicians you could have chosen, mathematicians with strong computing connections like John Conway or Donald Knuth, or even famous female...
  7. Thread: Super language.

    by risby
    Replies
    23
    Views
    5,888

    It does seem like a strange question - here's my...

    It does seem like a strange question - here's my strange response.

    A language that can do everything that the computer can do is its processor's assembly language. Unfortunately the computer can...
  8. Replies
    5
    Views
    1,216

    You haven't declared character variable z and you...

    You haven't declared character variable z and you haven't passed the address of that variable as a parameter to scanf(). Otherwise it's OK, but the prompt isn't very helpful to the user about what it...
  9. Replies
    6
    Views
    1,654

    Oh yeah ... it's that other one init ... I'm...

    Oh yeah ... it's that other one init ... I'm always getting those two confused ... um ... ?
  10. Replies
    6
    Views
    1,654

    As you say, bubble sort swaps adjacent elements....

    As you say, bubble sort swaps adjacent elements. It also sets a flag to show that a swap has taken place and repeats until the flag remains unset on a pass through the array.

    This is a Shell sort...
  11. Thread: my problem...

    by risby
    Replies
    7
    Views
    1,596

    No, I was thinking of something like: double...

    No, I was thinking of something like:


    double tm; /* <-------- for storing fractional part */

    lc = jdn; /* <------ this gets the integer part; the number of days */
    tm =...
  12. Thread: New to C...

    by risby
    Replies
    3
    Views
    1,021

    Hmmm, let's see now ... 111111.111111 * 6 =...

    Hmmm, let's see now ...

    111111.111111 * 6 = 666666.666666

    Perhaps you'd better write a test harness for your algorithm Queatrix
  13. Thread: my problem...

    by risby
    Replies
    7
    Views
    1,596

    If you truncate the double jdn by storing it into...

    If you truncate the double jdn by storing it into a long integer and then subtract that integer from jdn you'll be left with the decimal part. You could then multiply by 1,000,000 to move it up past...
  14. Thread: Multiple of 3

    by risby
    Replies
    3
    Views
    1,666

    Don't you count the modulus operator '%' as an...

    Don't you count the modulus operator '%' as an arithmetic operator then?
  15. Replies
    11
    Views
    1,579

    Yeah, it is mighty difficult to translate to...

    Yeah, it is mighty difficult to translate to human speech. Try this:

    given n is a non-zero positive integer the outer loop executes n times
    each time limiting the inner loop index to vary from 1...
  16. Replies
    3
    Views
    2,748

    Nice, Max. Kudos.

    Nice, Max. Kudos.
  17. Replies
    5
    Views
    1,205

    I would say that real life does not have sort of...

    I would say that real life does not have sort of clear answers for which you seem to be looking. There is no finishing line to cross unless you are doing some sort of academic qualification or,...
  18. Replies
    11
    Views
    1,579

    OK Ralphy, that's good to hear, keep up the good...

    OK Ralphy, that's good to hear, keep up the good work.

    Now, he he, there's just one little thing. How many times will each loop execute?
  19. Replies
    11
    Views
    1,579

    No, it doesn't! No, it doesn't! Here is...

    No, it doesn't!


    No, it doesn't!

    Here is some info about for loops where you'll learn things like "initialization allows you to give a value to a variable, the condition tells the program...
  20. Replies
    5
    Views
    14,364

    A couple of weeks ago I was checking to see if...

    A couple of weeks ago I was checking to see if there was a more recent java development kit from Sun and I found Netbeans 5.0. I've not yet played around with it but it is for Java development not C...
  21. Replies
    9
    Views
    5,113

    Ah ha! #define LINUX_REBOOT_MAGIC2B ...

    Ah ha!


    #define LINUX_REBOOT_MAGIC2B 369367448
    369367448 decimal = 16041998 hexadecimal

    16041998 could be viewed as 16th April 1998

    Linus Torvalds' second daughter, Daniela Yolanda,...
  22. Replies
    9
    Views
    5,113

    LINUX_REBOOT_CMD_RESTART 0x01234567 ---> first...

    LINUX_REBOOT_CMD_RESTART 0x01234567 ---> first 8 congituous digits
    LINUX_REBOOT_CMD_HALT 0xCDEF0123 ------> last 4 contiguous digits followed by first 4
    LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF...
  23. Replies
    9
    Views
    5,113

    If those are addresses I'll eat my hat. They are...

    If those are addresses I'll eat my hat. They are ordered sequences of hex digits. Even MAGIC2B is 0x16041998, I wonder what is significant about the 16th of April 1998.
  24. Replies
    29
    Views
    6,106

    Oranges are spherical and coloured orange....

    Oranges are spherical and coloured orange. Bananas are more cylindrical and coloured yellow, often with black spots.
  25. I do not like foo, bar and baz I just can't cope...

    I do not like foo, bar and baz
    I just can't cope with all that jazz

    I do not like them in my code
    I won't be going down that road

    They won't appear in my program
    Not even for green eggs...
Results 1 to 25 of 74
Page 1 of 3 1 2 3