0

It's not necessary I fix this 'issue' since it's a more aesthetic thing. I was just wondering if it's possible to indent code that comes under the "public:" deceleration after indenting the deceleration itself.

So it would look like this:

class Myclass{
    public:
        void test(){
        }
}

At the moment the void part would be directly underneath the public modifier. I have looked through the formatting setting and yet cannot find how to do this.

William
  • 51
  • 6

1 Answers1

0

In visual studio open Tools/Options. In the menu on the left choose Text Editor->C/C++->Formatting. There you can change a lot of things like indentation.

rashmatash
  • 1,699
  • 13
  • 23
  • there is a part that lets you indent access modifiers `public`, `protected` and `private`, so it will have the effect you're looking for. – rashmatash Jul 24 '14 at 20:37
  • Doing that just makes `public` and `void` in line with each other – William Jul 25 '14 at 10:14
  • I assume you'd like the code to look like this? http://prntscr.com/45yw2x Then you'll have to uncheck "indent access specifiers" in formatthing/indentation. – rashmatash Jul 25 '14 at 11:15
  • Yes but I was hoping for public to be indented once and void to be indented (and any other code after it) to be indented twice. I suppose it doesn't work any other way then? – William Jul 25 '14 at 14:29
  • Aha, I see. I don't think so, or at least not that I know. – rashmatash Jul 25 '14 at 14:30
  • Well, it doesn't effect the code so I guess that's no problem then. Thanks for the help anyway rashmatash. – William Jul 25 '14 at 14:52