作者查詢 / tomnelson

總覽項目: 發文 | 留言 | 暱稱
作者 tomnelson 在 PTT 全部看板的留言(推文), 共1760則
限定看板:全部
[語法] 一題是非題..
[ C_and_CPP ]29 留言, 推噓總分: +18
作者: robert6408 - 發表於 2009/04/11 20:30(15年前)
17Ftomnelson:The statement is valid in pure C language, but not04/12 02:59
18Ftomnelson:in C++ language. The word "friend" is a preserved04/12 03:02
19Ftomnelson:keyword of C++ language. So, got it?04/12 03:03
Re: [問題] 請求幫忙解釋C語言
[ PLT ]8 留言, 推噓總分: +1
作者: tomnelson - 發表於 2009/04/10 04:14(15年前)
5Ftomnelson:以上兩位說的都對, 不過Dev-C++是用GCC(mingw)吧? 我本04/21 11:01
6Ftomnelson:身是用mingw+msys試是會過的! 我常用void main(void)來04/21 11:04
7Ftomnelson:寫一些function的test case, 嗯, 不過勤勞點寫int main04/21 11:05
8Ftomnelson:然後回傳個0是值得被鼓勵的, 謝謝以上兩位意見喔!04/21 11:06
Re: [問題] 遞迴的定義?
[ C_and_CPP ]14 留言, 推噓總分: +1
作者: dodo302 - 發表於 2009/04/09 04:06(15年前)
8Ftomnelson:簡單一句話這樣說吧! 遞迴function在進到最後一層後, 由04/10 02:20
9Ftomnelson:於要往上一層返回, 而且要依序往上一層返回並傳回結果,04/10 02:22
10Ftomnelson:所以必須在先前一層一層進入時儲存目前結果, 所以須要有04/10 02:23
11Ftomnelson:stack的結構來存資料, 這是LIFO(Last In First Out), 不04/10 02:26
12Ftomnelson:就剛好符合上面一層層進入再一層層退出的行為模式嗎? 所04/10 02:28
13Ftomnelson:以早期無法支援stack的機器上, 就無法支援遞迴囉! 但是04/10 02:29
14Ftomnelson:用其他方式其實還是可以辦到的!(模擬stack)04/10 02:30
[問題] pthread關於線程1條件成立時,加入線程2......
[ C_and_CPP ]18 留言, 推噓總分: 0
作者: minghaoo - 發表於 2009/04/08 21:08(15年前)
6Ftomnelson:感覺滿簡單的,也不用用什麼event來做,用global var就可04/10 02:08
7Ftomnelson:以了, 你把thread1~3先分別寫成三個function, 然後用一04/10 02:10
8Ftomnelson:個 while(1) 或 for(;;) 的 loop 把三個function包起來,04/10 02:11
9Ftomnelson:然後你會怎麼樣安排global var讓三個function依你的意思04/10 02:12
10Ftomnelson:去跑咧? 我這提示夠明顯了吧! 好好動腦一下吧!04/10 02:13
11Ftomnelson:以上只是提供你一個思路,真正的pthread部份run起來可能04/10 02:14
12Ftomnelson:會有先後create/run的issue存在,不過如果你安排得當,倒04/10 02:16
13Ftomnelson:是不會有什麼問題的! 加油!04/10 02:16