Networking Code Problem
I study Beej and produced the following code :
Code:
#include <stdio.h> Code:
54 input[64] = input_terminal(); |
Well input[64] = input_terminal(); says in the 64th character copy the result from the function input_terminal(). Not I suspect what you want to do.
If I remember correctly scanf("%s",... will read in the first character up to the first white space (hence it will be GET rather than GET HTML) but check this by printing out the value. What you want to do is to pass input without the square brackets, in effect this will be a pointer to the first location in the character array. |
You're missing 2 include file (stdio.h and arpa/inet.h)
Code:
char input_terminal() For debugging, I've added an additional printf (which proofs graemef's point that scanf does not read everything). Also, scanf does not read the newline. You can see that as the '<<' occurs on the same line. |
All times are GMT -5. The time now is 12:06 PM. |