問題タブ [addressof]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
249 参照

c++ - Determining the Parameter Types of an Undefined Function

I've recently learned that I cannot:

  1. Take the address of an undefined function
  2. Take the address of a templatized function with a type it would fail to compile for

But I've also recently learned that I can call decltype to get the return type of said function

So an undefined function:

I'd like to know if there's a way that I can match the parameter types to the types in a tuple. This is obviously a meta programming question. What I'm really shooting for is something like decltypeargs in this example:

Can anyone help me understand how decltypeargs could be crafted?

0 投票する
3 に答える
1365 参照

c - Address of dereferenced pointer construct

In unqlite c library I found following code:

where pVm is:

and function called is declared as:

What for construct &(*pVm) is used in call instead of just pVm? Is &(*pVm) equivalent to pVm?

0 投票する
3 に答える
119 参照

c - 配列要素のアドレスへのポインタ

出力表示は

私たちが知っている*(&Variable)ように、変数の値を出力しますが、上記のプログラムで同じ概念を実装すると...

出力は、配列の各要素のアドレスを示しています。

なぜこれが起こっているのですか?出力が配列の要素の値と等しくないのはなぜですか??

0 投票する
3 に答える
108 参照

c++ - 2 次元配列の特定の行を指す

2 次元配列の最初の行を指す次のコードを書きました。しかし、私がするとき

私は結局得ます

エラー:代入で変換できませdouble (*)[1]double*

私のプログラムは次のとおりです。

誰かが私がどこで間違っているのか理解するのを手伝ってくれますか?

0 投票する
1 に答える
661 参照

c - 配列へのポインター (&array で実行) が配列自体と等しいのはなぜですか?

だから、彼らがそれを書いたとき、私はほとんどクラスメートに大騒ぎしました

&array最初の要素のアドレスを提供します

しかし、彼らは正しいことがわかりました。これは私には矛盾しているように聞こえます。次のように定義された配列について話しています。

変数numbersは(私が思うに)タイプint* constです。それへのポインタはint** const. しかし、どうやらこの式は true と評価されます。

そしてもちろん、これも真です。

したがって、明らかに、その配列のアドレスを保持する変数へのポインターを取得できません。表現&numbersは本質的に無意味です。たぶん、コンパイラによって削除されることさえあります。

それはどのように可能ですか?私は今とても混乱しています!標準はこの動作をどのように説明していますか? これを確認するためのイデオン テスト コードを作成しました: http://ideone.com/pYffYx

0 投票する
1 に答える
228 参照

c++ - アドレス (&) と間接演算子の正しい形式は何ですか?

アドレス演算子 (&) と間接演算子 (*) のさまざまな書き方を見てきました。

私が間違っていなければ、次のようになります。

たとえば、2 つの間にスペースを入れて&varasと書いたらどうなるでしょうか。& var私が見た一般的な構文: char* line = var;char * line = var;、およびchar *line = var;.