2011年2月9日 星期三

fscanf usage ( Parse Command Line )

在寫有關於Printer 的AP的時候,要parse command line from file.
使用 fwscanf 遇到問題,在google並在WIN32下debug和實驗後,找到解法。

http://support.microsoft.com/kb/60336/en-us

第一個fwscanf 之後的 fwscanf都parse 不出來 ( return 0 )
因為 file pointer 停在 delimiter 前面,後續呼叫會失敗
所以要加 %*c