CPP06 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Ex00: Conversion of scalar types

This exercise is about using the static_cast.

Scalar conversion

Does the program work as required? Did the student use the static_cast to convert values? We'll accept the use of implicit casts for promotion casts only.

Anyway, please don't be too uncompromising towards the exercise's outputs if the spirit of the exercise is respected.

Even if this exercise is wrong, continue the evaluation process.

日本語訳

Ex00: スカラー型の変換
この練習問題は static_cast を使うものです。
スカラー変換
プログラムは要求通りに動きますか?生徒は static_cast を使って値を変換しましたか?
暗黙のキャストの使用は、のキャストに限り認めます。
いずれにせよ、演習の精神が尊重されるのであれば、演習のアウトプット()に対してあまり妥協しないでください。
この演習が間違っていたとしても、評価作業を続けてください。

Ex01: Serialization

This exercise is about using the reinterpret_cast.

Retyping of raw data

Does the program work as required?

The reinterpret_cast<> should be used twice.

First from data* to uintptr_t.

Then, from uintptr_t to data*.

And the final data struct should be usable.

日本語訳

Ex01: Serialization
この演習はreinterpret_castの使い方についてです。
生データの再定義
プログラムは要求通りに動くか?
reinterpret_cast<>は2回使う。
まずdata*からuintptr_tへ。
次に、uintptr_tからdata*へ。
そして最後のデータ構造体は使用可能でなければならない。

Ex02: Identify real type

This exercise is about using the dynamic_cast.

Real type identification

Does the program work as required?

Check the code. Did the student use the dynamic_cast to identify the real type?

void identify(Base* p) : should check if the cast return is NULL.

void identify(Base\& p) : should use a try and catch block to check if the cast failed.

(In case you're wondering, the header must not appear anywhere.)

日本語訳

Ex02: 実数型の識別
dynamic_castを使った練習です。
実数型の識別
プログラムは要求通りに動くか?
コードをチェックしてください。生徒はdynamic_castを使って実際の型を特定したか?
void identify(Base* p) : キャストリターンがNULLかどうかをチェックする必要がある。
void identify(Base* p) : キャストが失敗したかどうかをチェックするためにtryとcatchブロックを使うべきである。
(念のため言っておくが、ヘッダーはどこにも出てきてはならない。)