Go to the FreeLists Home Page Home Signup Help Login
 



[haiku-development] || [Date Prev] [03-2008 Date Index] [Date Next] || [Thread Prev] [03-2008 Thread Index] [Thread Next]

[haiku-development] Re: coding style

  • From: Gabriele Biffi <mlist@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 03 Mar 2008 13:13:22 +0100
Axel Dörfler wrote:
Gabriele Biffi <mlist@xxxxxxxxx> wrote:
Axel Dörfler wrote:
* use "char* variable" instead of "char *variable" in C++ code
I think "char *variable" is better, because if you write "char* variable1, variable2" can be confusing (variable2 isn't a pointer).

That's easy to solve: just don't use that anymore :-)
The reason for putting the '*' to the type is that it is actually part of the type, not of the variable name; I would even consider the outcome of "char* a, b" a bug in the language grammar.

That's not a bug, there is a good reason for that. I can't think of a good example right now, I'll look into that.


Now consider this:

char* variable1, *variable2;

:-)


Best regards,

Gabriele







[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.