実際にどう使われますか?
下の例文を通して、それぞれの単語がどのような状況で使われるのか学んでみましょう!
dereference
例文
To get the value of a variable, you need to dereference the pointer pointing to it. [dereference: verb]
変数の値を取得するには、その変数を指すポインタを逆参照する必要があります。[逆参照:動詞]
例文
The program crashed because the pointer was not properly dereferenced. [dereferenced: past tense]
ポインターが正しく逆参照されなかったため、プログラムがクラッシュしました。[逆参照:過去形]
retrieve
例文
I need to retrieve my keys from the lost and found. [retrieve: verb]
紛失物から鍵を取得する必要があります。[取得:動詞]
例文
The function retrieves the data from the database and displays it on the screen. [retrieves: present tense]
この関数は、データベースからデータを取得し、画面に表示します。[取得:現在形]
追加で知っておくといいこと
どっちの方がよく使われますか?
Retrieveは日常の言葉でdereferenceよりも一般的に使われています。Retrieveは幅広い文脈で使用できる用途の広い単語ですが、dereferenceはより技術的でコンピュータープログラミングに固有のものです。
どっちの方がよりフォーマルですか?
Dereferenceは、通常、公式または技術的なコンテキストで使用される技術用語ですが、retrieveは公式と非公式の両方の設定で使用できます。