[問題] c++ gettoken疑問
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
c++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
INFIX->POSTFIX問題
餵入的資料(Input):
test01.txt
只有一行2 * ( 3 + 4 ) * 5
預期的正確結果(Expected Output):
token stack Top Output
2 empty -1 2
* * 0 2
( * ( 1 2
3 * ( 1 23
+ * ( + 2 23
4 * ( + 2 234
) * 0 234+
* * 0 234+*
5 * 0 234+*5
eos empty -1 234+*5*
錯誤結果(Wrong Output):
目前只印的出token這行,因為看不懂書上指標跟gettoken方法
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/cKifNfo9
補充說明(Supplement):
感謝下面大大指教,我太廢了,希望能繼續給我指點跟批評
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.242.9.40
→
11/11 14:04, , 1F
11/11 14:04, 1F
→
11/11 14:11, , 2F
11/11 14:11, 2F
→
11/11 14:14, , 3F
11/11 14:14, 3F
→
11/11 15:07, , 4F
11/11 15:07, 4F
→
11/11 15:17, , 5F
11/11 15:17, 5F
→
11/11 15:19, , 6F
11/11 15:19, 6F
※ 編輯: artorius 來自: 111.242.9.40 (11/11 15:31)
※ 編輯: artorius 來自: 111.242.9.40 (11/11 15:34)
→
11/11 15:36, , 7F
11/11 15:36, 7F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章