→ tsaiminghan:vecotor不是本身就有排序的方法? 05/25 22:00
→ tsaiminghan:我對stl不熟,不知道這樣行不行? &ivector[i] 05/25 22:01
→ herman602:作業規定排序必須自己寫 不能使用stl內建的 05/25 22:05
→ herman602:所以才有這樣的需求 05/25 22:05
推 tsaiminghan:現在學校有教stl? 05/25 22:07
→ herman602:我希望可以一次傳入整個vector, 然後直接存取 05/25 22:08
→ herman602:但又不要用到額外空間, 所以想要採用call by reference 05/25 22:10
推 tsaiminghan:你要是傳入vector當參數嗎? 05/25 22:11
→ herman602:對@@ 05/25 22:11
→ tsaiminghan:aaa(vector<int> &vec) 這樣不知道對不對 05/25 22:13
→ tsaiminghan:傳參考的方式 05/25 22:14
→ herman602:無法將參數 1 從 'std::vector<_Ty> *' 轉換成 05/25 22:18
→ herman602:'std::vector<_Ty> &' 05/25 22:19
→ herman602:阿 呼叫的時候弄錯了 應該是 aaa(vec); 這樣 05/25 22:21
→ herman602:問題解決了 感謝:) 05/25 22:21
→ tsaiminghan:在function內用的時 ,直接用不用加* 05/25 22:21
→ tsaiminghan:解決了,那就沒事了 05/25 22:22