[問題] project2

看板CSIE_Network作者 (哲肥)時間14年前 (2011/05/26 06:20), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/8 (看更多)
我想請問一下 1.大家是怎麼從stdin讀到完整(包括空白)的句子 我查了一下 有人是使用scanf("%[^\n]",buf) ; 的方法 或是fgets 奇怪的是 都沒有成功@@ 2.我在跑server的時候對他傳入"__NICKNAME__sendid;__USER_MSG__/send recvid /fi le filename /connseq 1EOT" 而我也確實在server印出的訊息發現我傳入的這個字串 但是sendid卻是收到NULL_USER..... 看樣子server應該是沒有把訊息傳給recvid... recvid應該是存在 因為sendid和recvid已經對傳過訊息了 我還試了從stdin 輸入"/send sendid /file filename" 這時server給sendid的回應是"__NICKNAME__server;__USER_MSG__request to send a file to [recvid],but miss the filename" 如此看來server在讀接收者ID應該是沒有出錯 試從stdin 輸入 "/send sendid /file filename /connseq" 或是 "/send sendid /file filename /connseq 3" 我的sendid就會收到NULL_USER.... 不知道有沒有人跟我遇到一樣的情況@@?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.4.195 ※ 編輯: jpm9ie8c 來自: 140.112.245.29 (05/26 15:13)
文章代碼(AID): #1DtO2gYT (CSIE_Network)
討論串 (同標題文章)
文章代碼(AID): #1DtO2gYT (CSIE_Network)