Search:

Type: Posts; User: kpreston

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    1,548

    kpreston

    Try using a while loop:



    while (fahrenheit > 300) {
    // Do stuff...
    }


    Don't forget to change fahrenheit every iteration.
  2. Replies
    27
    Views
    3,672

    fgets needs to collect data as long as the bot is...

    fgets needs to collect data as long as the bot is connected to the server (which, ideally, is 24/7). It only stops when one of the users on the server issues the !quit command. But by that point it's...
  3. Replies
    27
    Views
    3,672

    Appologetic bump. :(

    Appologetic bump. :(
  4. Replies
    27
    Views
    3,672

    AFAIK I don't have either of those options...

    AFAIK I don't have either of those options available to me. :( It seems the only option I have right now is to remove the fgets. Now, how can I have handle:



    while (running) {
    ...
    }

    ...
  5. Replies
    27
    Views
    3,672

    It still leaves the window open until I hit...

    It still leaves the window open until I hit enter. :(
  6. Replies
    27
    Views
    3,672

    Do you know of any quick and dirty ways to just...

    Do you know of any quick and dirty ways to just end the program?
  7. Replies
    27
    Views
    3,672

    I'm porting it to linux after completion. And no,...

    I'm porting it to linux after completion. And no, I can't write to stdin. That was just a wild guess, before doing research.
  8. Replies
    27
    Views
    3,672

    I'm not printing to stdin. I'm closing stdin, and...

    I'm not printing to stdin. I'm closing stdin, and trying to print to stdout. Once fclose is called, nothing is printed. The line before the fclose call prints, but nothing after. Also, stdin is not...
  9. Replies
    27
    Views
    3,672

    if (fclose(stdin) == 0) {...

    if (fclose(stdin) == 0) {
    printf("LOLSUCCESS\n");
    } else {
    printf("error: %d\n", errno);
    }
    printf("blah\n");


    Prints nothing. :(
  10. Replies
    27
    Views
    3,672

    I have to hit enter before it breaks, which makes...

    I have to hit enter before it breaks, which makes sense. I'm just trying to find a way around it.
  11. Replies
    27
    Views
    3,672

    I already mentioned how cmd_quit is being called....

    I already mentioned how cmd_quit is being called. The issue has nothing to do with my running variable, and everything to do with fgets.
  12. Replies
    27
    Views
    3,672

    The thread receiving data from the server.

    The thread receiving data from the server.
  13. Replies
    27
    Views
    3,672

    I thought exit() would simply close the program....

    I thought exit() would simply close the program. :|

    running = 0 is ment to break the loop. The problem is that fgets is blocking. I've tried select, which doesn't work on nonsockets in Windows....
  14. Replies
    27
    Views
    3,672

    Exit(0) and Infinite Loop

    while (running) {
    fgets(buffer, 128, stdin);
    if (buffer[strlen(buffer) - 1] == '\n') { buffer[strlen(buffer) - 1] = '\0'; }
    for (i = 0; i < bots[0].count; i++) {
    sprintf(sendbuf,...
  15. Replies
    4
    Views
    2,216

    How Big is Too Big

    When should I start breaking up a file and putting similar functions in their own headers? How big is too big?
  16. Replies
    16
    Views
    3,025

    Okay. Thank you, master5001.

    Okay. Thank you, master5001.
  17. Replies
    16
    Views
    3,025

    Oops. Good catch. Didn't notice my typo.

    Oops. Good catch. Didn't notice my typo.
  18. Replies
    16
    Views
    3,025

    Nifty. Thank you all for the quick responses. :)

    Nifty. Thank you all for the quick responses. :)
  19. Replies
    16
    Views
    3,025

    Critic my coding, please: It appears to work,...

    Critic my coding, please:
    It appears to work, but it looks pretty damn gross.



    int strircmp(const char *s1, const char *s2) {

    // Compare right hand side of s1 with s2, case insensitively...
  20. Replies
    16
    Views
    3,025

    Exactly.

    Exactly.
  21. Replies
    16
    Views
    3,025

    Compare. Similar to strnicmp, only the reverse...

    Compare. Similar to strnicmp, only the reverse...
  22. Replies
    16
    Views
    3,025

    String Comparison

    const char *s1 = "LOloLOLOLOLoLOL blAh";
    const char *s2 = "blah";


    How can I compare the right hand side of s1 to s2, case insensitively? Is there a standard function for this, or will I need to...
  23. Replies
    2
    Views
    998

    That's what I was wondering. Since ParseData...

    That's what I was wondering. Since ParseData isn't a thread, I wasn't sure if it was going to bottleneck at those function calls. And I don't have any trouble with syncronization so far. Each thread...
  24. Replies
    2
    Views
    998

    Multithreading and Function Calls

    I'm working on a chat client. Basically, I want to convert what I have now to a multi-threaded version. I'm having a hard time understanding the concept, however.

    ParseData(SOCKET, char *);...
  25. Thread: List

    by kpreston
    Replies
    3
    Views
    1,071

    Ended up using a linked list for this reason.

    Ended up using a linked list for this reason.
Results 1 to 25 of 69
Page 1 of 3 1 2 3