Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How do I make clang to ignore the indentations during formatting?

$
0
0

I have clang-format properly installed on my device. The Problem is whenever I format in my editor, I always get this:

int main() {  printf("Hello world!");  for (int i = 0; i < 5; i++) {    printf("%d", i);  }  return 0;}

My expected output is this:

int main() {    printf("Hello world!");    for (int i = 0; i < 5; i++) {        printf("%d", i);    }    return 0;}

As you can see, on my expected output, I wanted it to have an indentation (whenever I make curly braces), however on the output I get, the indentation gets reduced to two spaces per level.

I tried searching for solutions on YouTube, however I couldn't find one.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>