This is a matter of preference and somewhat holy war, as is the brace style.
Style
someType* somePtr;
emphasizes the type of pointer variable. He says essentially " somePtr type is a pointer to someType ."
Style
someType *somePtr
emphasizes the type of pointy data. He says, essentially, "the data type that somePtr , someType ."
Both of them mean the same thing, but it depends on whether the given mental model of the programmer when creating the pointer is "so", so to speak, according to pointed data or a pointer variable.
Put it in the middle (like someType * somePtr ) to avoid fixing one of them.
Tyler McHenry Apr 18 2018-10-18T00: 00Z
source share