動くけど、C言語の流儀は無視した作りになってしまった…。 parseURLではsubstringっぽい処理が多い。 C言語では区切りたい所に\0を突っ込んで終わりを示すのが普通らしい。 関数がポインタを返すのもよくないのかも知れない。 ソースは大体ここから。 C 言語で HTTP クライアントを作ってみよう (1) http://x68000.q-e-d.net/~68user/net/c-http-1.html #include <stdio.h> #include <stdlib.h> #include <string.h> #include <netdb.h> #include <sys/socket.h> #include <netinet/in.h> #define BUF_LEN 256 typedef struct { char schema[10]; char domain