Search:

Type: Posts; User: barramundi9

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. How to make it accept multi-client connections?

    Dear all:

    How can I use fork() to create multiple client access and at the same time make the server echo back the strings to the clients? Any idea?

    Thanks.




    #include <stdlib.h>
  2. Yes, you are right ... I changed it and it...

    Yes, you are right ...

    I changed it and it looks better now, thanks for the tip!

    hc
  3. Because I need to be able to compare and subtract...

    Because I need to be able to compare and subtract the time with the previous string (record) ...
  4. Hi, Guys, problem solved, below is the source...

    Hi, Guys, problem solved, below is the source code, in case anyone running into the same problem, any suggestion to make it "prettier" is appreciated, thanks again.



    #include <stdio.h>...
  5. This works, thanks, but there were some weird...

    This works, thanks, but there were some weird numbers in between, I'll fix it, thanks very much.

    hc
  6. I tried with the delimiter ":" and the result was...

    I tried with the delimiter ":" and the result was

    2013-123-00
    12
    11

    I'll take your suggestion using -, thanks.

    hc
  7. How to discard the rest of the characters in a string?

    Dear all:

    I use fopen() and fgets() to read from a file line by line. I would like to extract the string in between, for example:

    2013-123-00:12:11 xxxxxxxxxxxxxxxxx

    "00:12:11" is the part...
  8. Replies
    5
    Views
    56,277

    Hello, oogabooga I actually tried send both...

    Hello, oogabooga

    I actually tried send both and it still returns 4.

    I have given up on that and use libmodbus instead.

    libmodbus.org - News
    Libmodbus works like a charm.

    Thanks for the...
  9. Replies
    5
    Views
    56,277

    I decide to rewrite the code and the following is...

    I decide to rewrite the code and the following is what I have done:




    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    #include <fcntl.h>
  10. Replies
    5
    Views
    56,277

    Hi, Salem, thanks for the reply, I know it's been...

    Hi, Salem, thanks for the reply, I know it's been a month ...

    It was me and I did try swapping the crc bytes but it still returns -1

    And I did called modbus_init() first and it was connected,...
  11. Replies
    5
    Views
    56,277

    modbus rtu c programming

    Dear all:

    I am trying to use some function I downloaded from the internet to connect to a modbus meter, the connection is fine, but when I try to read the data off the registers, it kept returning...
  12. Replies
    2
    Views
    893

    OMG ... I am so dumb ... Thanks

    OMG ... I am so dumb ...

    Thanks
  13. Replies
    2
    Views
    893

    I/O operation on binary file

    Dear all:

    I have the following:



    typedef struct {
    int number;
    char str[15];
    } RECORD;
  14. Got it working, thanks so much, TomasRiker.

    Got it working, thanks so much, TomasRiker.
  15. multidimensional character array question

    Dear all:

    I have a structure that goes that this:



    typedef struct someStruct {
    char name[30];
    int number;
    } someStruct_t;
  16. Replies
    6
    Views
    1,400

    After drawing on paper, I see what you mean now. ...

    After drawing on paper, I see what you mean now. Thank you, oogabooga and everyone.

    Regards,
    barramundi9
  17. Replies
    6
    Views
    1,400

    OMG, you're right. It is fairly obvious ... my...

    OMG, you're right. It is fairly obvious ... my mistake. Once I change the if statement to if ((s->top) >= (max-1)), it works, thanks, claudiu.

    Any idea as to why the stack always grew to the...
  18. Replies
    6
    Views
    1,400

    Thanks for the suggestion, laserlight. Actually,...

    Thanks for the suggestion, laserlight. Actually, that was what I did at first, but the output was weird, so I changed it.

    Now I've changed to return 1 when it's full or empty and 0 when it's not,...
  19. Replies
    6
    Views
    1,400

    Weird stack problem

    My stack.h file :



    /* stack using array implementation */

    #include <stdio.h>
    #include <stdlib.h>
    #define max 5
  20. Replies
    7
    Views
    1,525

    Hi, Adak Thanks for the advice. I'll take...

    Hi, Adak

    Thanks for the advice. I'll take your suggestion to use the debugger and go through the iterations, see what happens.

    Thanks again.
  21. Replies
    7
    Views
    1,525

    You mean I should try to print the first row and...

    You mean I should try to print the first row and see what happens next?
  22. Replies
    7
    Views
    1,525

    The one dimensional array thing is part of the...

    The one dimensional array thing is part of the assignment ...
  23. Replies
    7
    Views
    1,525

    My sudoku solver problem

    Hi, everyone

    I wrote the following to check whether my sudoku game has a solution (all the functions it used are shown below:



    int hasSolution (sudokuGrid game) { //typedef char...
  24. Replies
    4
    Views
    3,468

    I think I misunderstand the usage of alarm(), is...

    I think I misunderstand the usage of alarm(), is there a way I can make SIGUSR1 to behave like SIGALRM?

    Thanks.
  25. Replies
    4
    Views
    3,468

    signal handler does not print

    Dear all:

    How come the program below returns alarm clock but does not print "signal sent!!"?What did I do wrong?

    Thanks




    /* Using a signal handler */
Results 1 to 25 of 38
Page 1 of 2 1 2