none
Is there an option to select the spacing of pointer declarators?

    Question

  • Visual Studio likes to change my pointer and reference declarator spacing while autoformatting:

    int fun(P* p, R& r);

    will be changed to:

    int fun(P * p, R & r);

    How can I prevent that form happening? Is there an option to select the desired spacing?

    Friday, February 24, 2017 1:07 AM

All replies

  • Weird.  It definitely doesn't do that for me.  Do you have an extension or add-in?

    Some have requested that feature at uservoice in the past year...which makes me think it doesn't exist yet.

    • Proposed as answer by qing__Moderator Saturday, February 25, 2017 2:07 AM
    Friday, February 24, 2017 6:59 PM
  • Hi Roccoor,

    Which version VS you are using, in my VS2015 Enterprise Update3, I could not repro your issue. I suggest that you could do:

    1). Reset settings for C++:

    Click Tools->Import and Export Settings Wizard->Reset all settings->next->No->next->choose Visual C++->Finish.

    2). Please run VS in safe mode:

    Click Start->Developer Command Prompt for VS-> type “devenv.exe /SafeMode”

    3). Please make sure that your VS is the latest version.

    Please feel free to let me know your latest results.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Saturday, February 25, 2017 2:19 AM
    Moderator