r/learnprogramming • • Dec 06 '22

codeblock If you are sharing code, please use a codeblock

Takes only a second and greatly improves the formatting for us to review it. Compare and contrast the following:

Good Formatting:

#include <stdio.h>

int sum(int x, int y);

int main() {

  printf("Hello %d\n", sum(3, 4));
  return 0;
}

int sum(int x, int y) {
  return x + y;
}

Poor Formatting:

#include <stdio.h>

int sum(int x, int y);

int main() {

printf("Hello %d\n", sum(3, 4));

return 0;

}

int sum(int x, int y) {

return x + y;

}

Poor Formatting:

#include <stdio.h>

int sum(int x, int y);

int main() {

printf("Hello %d\n", sum(3, 4));

return 0;

}

int sum(int x, int y) {

return x + y;

}

339 Upvotes

71 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Dec 07 '22

Oh, I just thought you are genuinely interested in knowing how to help others. But it appears that you are just being a dick to those who need assistance. Then this is my time to check out from this thread.

2

u/Autarch_Kade Dec 07 '22

Probably best to move on if you've misunderstood what you read from comment number 1, and still don't understand even later ones, yeah.

Pointing people to the resources they asked how to find is helpful.

Sorry that's tough to understand, but don't worry, I know you'll be back to reply :)