1

When i click on Reformat Code Clion changes my pointers

from:

int* pointer;

to:

int *pointer;

How can i prevent that from happening?

I searched through the settings but couldn't find anything.

2501
  • 25,460
  • 4
  • 47
  • 87
TheDoctor
  • 2,362
  • 4
  • 22
  • 39
  • You should prefer `int *pointer`, other wise `int* pointer1, pointer2;` doesn't do what you probably want. – cleblanc Mar 09 '17 at 14:31
  • That might be right but i never would initialize multiply variables in one line/statement. – TheDoctor Mar 09 '17 at 14:33
  • @ABusyProgrammer; They are saying, they would never create multiple pointer variables on the same line. IE: `int *ptr, *ptr2, *ptr3`.. They'd do: `int* ptr; int *ptr2; int *ptr3;` instead. – Brandon Mar 09 '17 at 15:24
  • Oh, that was a spelling error in OP's comment. My bad there. – BusyProgrammer Mar 09 '17 at 15:26
  • In that case, visit https://www.jetbrains.com/help/clion/2016.3/code-style.html . This link provides information on how to adjust code style. – BusyProgrammer Mar 09 '17 at 15:29
  • You can also try this link: http://stackoverflow.com/questions/35550885/clion-code-formatting-to-align-variables . – BusyProgrammer Mar 09 '17 at 15:31
  • Thanks, It seems you can set the alignment of pointers in the code style settings. I may have overlooked it – TheDoctor Mar 13 '17 at 21:34

1 Answers1

0

The alignment of pointers can be set in the code style settings.

TheDoctor
  • 2,362
  • 4
  • 22
  • 39