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>
Type: Posts; User: barramundi9
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>
Yes, you are right ...
I changed it and it looks better now, thanks for the tip!
hc
Because I need to be able to compare and subtract the time with the previous string (record) ...
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>...
This works, thanks, but there were some weird numbers in between, I'll fix it, thanks very much.
hc
I tried with the delimiter ":" and the result was
2013-123-00
12
11
I'll take your suggestion using -, thanks.
hc
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...
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...
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>
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,...
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...
OMG ... I am so dumb ...
Thanks
Dear all:
I have the following:
typedef struct {
int number;
char str[15];
} RECORD;
Got it working, thanks so much, TomasRiker.
Dear all:
I have a structure that goes that this:
typedef struct someStruct {
char name[30];
int number;
} someStruct_t;
After drawing on paper, I see what you mean now. Thank you, oogabooga and everyone.
Regards,
barramundi9
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...
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,...
My stack.h file :
/* stack using array implementation */
#include <stdio.h>
#include <stdlib.h>
#define max 5
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.
You mean I should try to print the first row and see what happens next?
The one dimensional array thing is part of the assignment ...
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...
I think I misunderstand the usage of alarm(), is there a way I can make SIGUSR1 to behave like SIGALRM?
Thanks.
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 */