問題タブ [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.
c++ - Determining the Parameter Types of an Undefined Function
I've recently learned that I cannot:
- Take the address of an undefined function
- 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?
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
?
c - 配列要素のアドレスへのポインタ
出力表示は
私たちが知っている*(&Variable)
ように、変数の値を出力しますが、上記のプログラムで同じ概念を実装すると...
出力は、配列の各要素のアドレスを示しています。
なぜこれが起こっているのですか?出力が配列の要素の値と等しくないのはなぜですか??
c++ - 2 次元配列の特定の行を指す
2 次元配列の最初の行を指す次のコードを書きました。しかし、私がするとき
私は結局得ます
エラー:代入で変換できませ
double (*)[1]
んdouble*
私のプログラムは次のとおりです。
誰かが私がどこで間違っているのか理解するのを手伝ってくれますか?
c - 配列へのポインター (&array で実行) が配列自体と等しいのはなぜですか?
だから、彼らがそれを書いたとき、私はほとんどクラスメートに大騒ぎしました
&array
最初の要素のアドレスを提供します
しかし、彼らは正しいことがわかりました。これは私には矛盾しているように聞こえます。次のように定義された配列について話しています。
変数numbers
は(私が思うに)タイプint* const
です。それへのポインタはint** const
. しかし、どうやらこの式は true と評価されます。
そしてもちろん、これも真です。
したがって、明らかに、その配列のアドレスを保持する変数へのポインターを取得できません。表現&numbers
は本質的に無意味です。たぶん、コンパイラによって削除されることさえあります。
それはどのように可能ですか?私は今とても混乱しています!標準はこの動作をどのように説明していますか? これを確認するためのイデオン テスト コードを作成しました: http://ideone.com/pYffYx
c++ - アドレス (&) と間接演算子の正しい形式は何ですか?
アドレス演算子 (&) と間接演算子 (*) のさまざまな書き方を見てきました。
私が間違っていなければ、次のようになります。
たとえば、2 つの間にスペースを入れて&var
asと書いたらどうなるでしょうか。& var
私が見た一般的な構文: char* line = var;
、char * line = var;
、およびchar *line = var;
.