0

I am purely new to C++, I did Java 10 years ago and between this I used mainly R and Perl.

Now I have to extend the code written by someone and I am confused with the using of the pointer operator"*".

Is there a difference between writing it at the end of the type (f.e. "unsigned char* thing"), or writing it at the beginning of the variables name (f.e. "unsigned char *thing")?

Even in books the "grammar" seems to differ, what leads me to a "should not differ" meaning, but I want to be sure, so I ask you...

Allerleirauh
  • 115
  • 3
  • 1
    There is no difference whatsoever. – Galik Oct 13 '20 at 08:22
  • The reasons why some people prefer to write it next to the variable is due to how the compiler parses such a definition (usually from inner to outer). E.g `int *abc` reads as "declare a variable abc which is a pointer to an object of type `int`) – Sebastian Hoffmann Oct 13 '20 at 08:51

0 Answers0