ぼるじょあがC/C++の宿題を片づけますYO! 68代目
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
500:homoじょあ ◆5OLf4yFnuM 07/09/02 21:47:59 (・3・) エェー B・・なんか意図が違う気がしてきたお int main(){ Cell *a, *b, *c, *d, *e, *header, *list; a = new Cell();b = new Cell();c = new Cell();d = new Cell();e = new Cell(); a->setNext(b);b->setNext(c);c->setNext(d);d->setNext(e); a->setValue(10);b->setValue(20);c->setValue(30);d->setValue(40);e->setValue(50); header = a; //Aの処理 c->setNext(c->getNext()->getNext()); header = header->getNext(); //Bで追加 a->setNext(c->getNext()); c->setNext(a); list = header; while(list != NULL){ std::cout << list->getValue() << std::endl; list = list->getNext(); } std::cout << std::endl; d->setNext(header); header = d; list = header; while(list != NULL){ std::cout << list->getValue() << std::endl; list = list->getNext(); } return 0; }
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
4361日前に更新/401 KB
担当:undef