Dear MSU,
You were our first of hopefully many Big Ten wins in a long time (we haven't won in 24 Big1T1en games). Please don't feel bad.
Love,
Marc
Dear MSU,
You were our first of hopefully many Big Ten wins in a long time (we haven't won in 24 Big1T1en games). Please don't feel bad.
Love,
Marc
I'm sitting in my hotel room and thinking about what's good about Dayton, OH. About the only thing I can think of is the Speedway station I can see out my window.
Yeah, gas is $2.259 a gallon here. Haven't seen that price in a loooong time.
Other than that? Not much.
UPDATE: It was $2.209 this morning. Can't wait to get back to Chicago.
fprintf()
, fgets()
, etc.). To do that you must create a stream handle from the socket using fdopen()
, and of course make sure you clean up your mess when you are done.fprintf()
to a socket (some things skipped for brevity):
int main(int argc, char **argv) { int sock; FILE *sockfd = NULL; : // setup and accept socket here sockfd = fdopen(sock, "w"); fprintf(sockfd, "pity the foo\n"); : // do other stuff }With most streams you can open them up in read (
r
), write (w
) modes. Also you can change either one to do both read and write by adding a +
so that it's either r+
or w+
.int main(int argc, char **argv) { int sock; char buf[2048]; FILE *wsockfd = NULL, *rsockfd = NULL; : // setup and accept socket here wsockfd = fdopen(sock, "w"); rsockfd = fdopen(sock, "r"); fprintf(wsockfd, "pity the foo\n"); fgets(buf, 2048, rsock); : // do other stuff }Of course, you should error check everything, etc. Also don't get the two mixed up (try to read from the write/write to the read) or you will have other issues.