-1

I'm new in this programming stuff so i don't really know how to describe my issue but i'm gonna try.

I starded using vscode for programming in c, i'm using the c/c++ extension there, but the {} (i don't even know it's name haha) is placed like:

if (a > b)
{
code;
}

while i wanted it to be like:

if (a > b){
code;
}

I would appreciate if you could tell me those terms, as well as recommending any place where i learn that, i'm at the really beginning so any help is great<3

  • The different positioning of the **braces** (aka *curly* or *squiggly brackets*) and spacing/new lines is part of a **indentation style**. *I don't know how to make Visual Studio use a specific detail in its style.* – pmg Oct 01 '21 at 13:00
  • 1
    Does this answer your question? [How do I set up VSCode to put curly braces on a new line?](https://stackoverflow.com/questions/32900921/how-do-i-set-up-vscode-to-put-curly-braces-on-a-new-line) --obviously you want to do the converse, but that's where the options are – Tim Randall Oct 01 '21 at 13:15

1 Answers1

0

Go to File => Preferences => Settings and then click on this icon up top.

Here

at the end of the last setting enter a comma , and then press enter and add this line below:

 "C_Cpp.clang_format_fallbackStyle": "Google"
Costa
  • 1,794
  • 1
  • 12
  • 21