Search:

Type: Posts; User: Hammer

Page 1 of 20 1 2 3 4

Search: Search took 0.05 seconds; generated 4 minute(s) ago.

  1. Replies
    1
    Views
    1,103

    The select function tests for read/write/error...

    The select function tests for read/write/error conditions on file descriptors. Here's an example that waits 10 seconds for you to enter some data via STDIN, before giving up:
    (its from the faq)

    ...
  2. Replies
    4
    Views
    2,757

    http://cboard.cprogramming.com/showthread.php?t=46...

    http://cboard.cprogramming.com/showthread.php?t=46333#postmenu_321434
  3. Replies
    4
    Views
    1,350

    Another stupidly addictive game

    Don't know if this has been posted before or not...

    http://members.iinet.net.au/~pontipak/redsquare.html

    My best so far is 19 seconds.

    [edit]
    Now 20.875 seconds :)
  4. Replies
    2
    Views
    4,642

    >char type; >type = fgetc(stdin) fgetc()...

    >char type;
    >type = fgetc(stdin)
    fgetc() doesn't return a char, it returns an int.
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048865140&id=1043284351
  5. Thread: asp die()

    by Hammer
    Replies
    4
    Views
    4,750

    Maybe use Response.End ...

    Maybe use Response.End

    http://www.w3schools.com/asp/met_end.asp
    http://www.w3schools.com/asp/asp_ref_response.asp
  6. Replies
    2
    Views
    1,375

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?a...

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1073433376&id=1073086407
  7. Replies
    12
    Views
    1,869

    In addition to my last post, the following will...

    In addition to my last post, the following will produce a list of all customers with last transaction date, including customers that don't have any transactions. In the latter case, the Max trans...
  8. Replies
    12
    Views
    1,869

    One way: SELECT customers.account,...

    One way:


    SELECT customers.account, Max(transactions.transactiondate) AS MaxOftransactiondate
    FROM customers INNER JOIN transactions ON customers.account = transactions.account
    GROUP BY...
  9. Replies
    11
    Views
    1,600

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?a...

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043372399&id=1043284385
  10. Replies
    8
    Views
    1,183

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?a...

    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1045691686&id=1043284392
    http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042856625&id=1043284385
  11. Replies
    16
    Views
    2,202

    You must error check fopen() and fscanf(). ...

    You must error check fopen() and fscanf().


    inp = fopen("junk1.txt", "r");

    if (inp == NULL)
    {
    perror("fopen");
    ...
    }
  12. Replies
    7
    Views
    1,215

    >>Make those variables global ... and they need...

    >>Make those variables global
    ... and they need to be global because ... ?

    In general terms, only use global variables if you need to share data between functions, and the design makes it hard...
  13. Replies
    7
    Views
    1,215

    >>are there any solution to make the random...

    >>are there any solution to make the random function just generates once
    Sure, just call it once. You'd need to make the variables static if you want to retain their values from one function call...
  14. Replies
    6
    Views
    2,063

    It's getting confused by the newline characters...

    It's getting confused by the newline characters that are output as part of the gcc --version command. Here's one solution:



    $ gcc -DGCCVERSION="\"$(gcc --version|tr '\n' ' ')\"" junk1.c

    $...
  15. Replies
    13
    Views
    1,662

    ... Sending car around where needed. The...

    ... Sending car around where needed. The variable is too small and the program requirements are too simplistic to warrant a pointer at this stage.

    Global variables should be your last choice. ...
  16. Replies
    13
    Views
    1,662

    >>I suggest that you make [car] a global...

    >>I suggest that you make [car] a global variable.
    I don't. Learn how to program properly from day one, don't bodge your program just to be lazy.
  17. Thread: simplify this?

    by Hammer
    Replies
    2
    Views
    1,200

    Forgetting the setup process, the addition of all...

    Forgetting the setup process, the addition of all the sides can be peformed using only one loop. For now, I'll leave it to you to figure out how ;)

    Also, are you sure your program does what you...
  18. Replies
    13
    Views
    1,662

    int displayval() { char car; ...

    int displayval()
    {
    char car;
    printf("Character: %c\t ascii: %u\t hex: %#X\n", car, car, car);
    return (0);
    }
    And what value do you expect car to have when printf() does it's work...
  19. Replies
    13
    Views
    1,662

    >> char car; >> car = getc(stdin); getc()...

    >> char car;
    >> car = getc(stdin);
    getc() returns an int, not a char. You compiler should be warning you of such errors, if it isn't, turning up the warning levels!

    The displayval()...
  20. Why would calling an additional function make it...

    Why would calling an additional function make it easier?
    ... and no, it wouldn't work anyway (see the comments above about NULL pointer initialisation)


    [goddamit, beat!]
  21. Replies
    8
    Views
    1,541

    Did you read:...

    Did you read: http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042834793&id=1043284351 ?
  22. Then dump the initFunction completely, and just...

    Then dump the initFunction completely, and just use the alloc:


    Matrix *allocMatrix(int row, int col)
    {
    Matrix *m;

    m = malloc(sizeof(*m)); /* Error check! */

    int i = 0;
  23. Replies
    9
    Views
    1,557

    getchar() reads from stdin (normally the...

    getchar() reads from stdin (normally the keyboard). If you want to read from the file, use fgetc() and pass it your fp variable.
  24. Replies
    1
    Views
    1,020

    You have junk in the input buffer, 'cos you're...

    You have junk in the input buffer, 'cos you're using scanf() to get the number. Two choices:

    Change the way you get the number:...
  25. Thread: pointer problem

    by Hammer
    Replies
    25
    Views
    2,869

    How did you get the file from your Windows...

    How did you get the file from your Windows machine to the *nix one?

    If you ftp it, using standard text mode transfer (normally default), then the CRLFs will be converted, meaning that CRLF on...
Results 1 to 25 of 486
Page 1 of 20 1 2 3 4