What’s the difference between float* varname and float *varname in classic C?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Formatting. That’s it. They mean the same thing.
Where you put the space (or if you even have one, really) is a matter of preference. Some prefer the * next to the varname so that you don’t get confused by something like:
(here, only a is a pointer, b is not)
Others argue that they never declare multiple variables at once, so they prefer the * next to float, since it’s part of the type.