哪些更正確,更廣泛使用?真正的問題是最後一個,我認爲這種行爲會改變。關於聲明語義的幾個問題
int *test; //for this, it is probably both?
int* test;
int& test;
int &test;
實際問題:
const int test;
int const test;
const int* test;
int* const test; //<-- I guess this also have a different meaning if I consider the last one?
const int& test;
int const& test; //also, considering last one, any difference?
const int*& test;
int* const& test; //<-- this is the correct one for stating "I won't modify the passed object, but I may modify the one pointed"? I have had problems with the other one sometimes, does the other one has some other meaning?
const int* const& test; //<-- another meaning?
此外,我會很高興,如果你能指出,如果你知道這個問題的任何視覺「ambiguations」。
有*是*裏面有一個有效的問題,如果你喜歡閱讀。如果你不知道答案,停止提議關閉。或者如果你不在乎,*** ***不在乎。 – Etherealone 2013-03-10 21:15:07
查看[bjarne的常見問題](http://www.stroustrup.com/bs_faq2.html#whitespace)指針之一。 **編輯**:[他也談論const的位置](http://www.stroustrup.com/bs_faq2.html#constplacement)。 – 2013-03-10 21:16:29
@JesseGood是的,我一直在閱讀。沒有與參考強硬的組合。我認爲這一切都是由指針引起的。雖然我會等待答案。 – Etherealone 2013-03-10 21:23:14