掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
C++問題・・について (ID:70149)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
同じく、クラス継承を使う意味が分からないです。 class IntegerBase{ private: int i; public: IntegerBase(int x){i=x;} int get(){return i;} void set(int x){i=x;} }; class IntegerInherit : public IntegerBase{ public: IntegerInherit(int x) : IntegerBase(x){} }; int main(){ int x; cout << "noを入力" << endl; cin >> x; IntegerInherit *no = new IntegerInherit(x); while(ファイルを1行読み込み、EOFではない) { if(atoi(その行) != no) continue; if(atoi(その行) == no) { その行を表示; break; } } delete no; }
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.