問題:
Why do most C programmers name variables like this:爲什麼大多數 C 程序員這樣命名變量:
int *myVariable;
rather than like this:而不是這樣:
int* myVariable;
Both are valid.兩者都有效。 It seems to me that the asterisk is a part of the type, not a part of the variable name.在我看來,星號是類型的一部分,而不是變量名稱的一部分。 Can anyone explain this logic?誰能解釋一下這個邏輯?
解決方案:
參考一: https://en.stackoom.com/question/1fdj參考二: https://stackoom.com/question/1fdj