0
我寫其中任意大的數由雙重鏈接列表,其中該列表中的一個節點表示的大量的一個數字表示的程序。c + +重寫>>操作
隨着問題的一部分,我需要這樣,當我在一個大的號碼類型,該程序使用該號碼所取的數量,並創建一個big_number類覆蓋「>>」操作符。 (big_number類是表示了大量的雙向鏈表。)
我改寫:
istream& >> operator(istream& in, big_number& n)
{
//Code I need to write
return in;
}
那麼你有什麼麻煩? – Radiodef 2014-11-02 04:27:57
你既沒有明確提到你面臨的問題,也沒有詳細說明你的課程描述。 – ravi 2014-11-02 04:33:39
我應該如何重寫它。我已經覆蓋了<<操作符,所以它看起來像:ostream的&運算符<<(ostream的進出,常量big_number&N) { \t如果(n.positive ==假) \t \t了<< ' - '; \t \t \t 節點*光標= n.head_ptr; \t while(cursor!= nullptr) \t { \t \t out << cursor-> data; \t \t cursor = cursor-> next; \t \t} \t回報的; } – SoraMarch 2014-11-02 04:33:59