Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

The most obvious weirdness about your code is the inconsistent indentation. Indeed I was convinced that there was a missing } at the end until I scanned the whole thing much more carefully. Indent everything within a function one level and add additional levels at each new nested statement. (user1118321 has generously provided a version with corrected indentation a version with corrected indentation)

The most obvious weirdness about your code is the inconsistent indentation. Indeed I was convinced that there was a missing } at the end until I scanned the whole thing much more carefully. Indent everything within a function one level and add additional levels at each new nested statement. (user1118321 has generously provided a version with corrected indentation)

The most obvious weirdness about your code is the inconsistent indentation. Indeed I was convinced that there was a missing } at the end until I scanned the whole thing much more carefully. Indent everything within a function one level and add additional levels at each new nested statement. (user1118321 has generously provided a version with corrected indentation)

thanks for trying
Source Link
luser droog
  • 2.1k
  • 15
  • 32

The most obvious weirdness about your code is the inconsistent indentation. Indeed I was convinced that there was a missing } at the end until I scanned the whole thing much more carefully. Indent everything within a function one level and add additional levels at each new nested statement. (user1118321 has generously provided a version with corrected indentation )

The most obvious weirdness about your code is the inconsistent indentation. Indeed I was convinced that there was a missing } at the end until I scanned the whole thing much more carefully. Indent everything within a function one level and add additional levels at each new nested statement.

The most obvious weirdness about your code is the inconsistent indentation. Indeed I was convinced that there was a missing } at the end until I scanned the whole thing much more carefully. Indent everything within a function one level and add additional levels at each new nested statement. (user1118321 has generously provided a version with corrected indentation )

less clever
Source Link
luser droog
  • 2.1k
  • 15
  • 32
 printf("Id\tName\t" "S1\tS2\tS3\t" "Total\n""Total\n\n"
 "\n%d\t%s\t"
  "%d\t%s\t" "%d\t%d\t%d\t" "%d\n",
 p[i]->id,p[i]->name,
 p[i]->sub[0],p[i]->sub[1],p[i]->sub[2],
 p[i]->total);
student *data = NULL;
int data_n = 0;
data = malloc((data_n=10) * sizeof*datasizeof *data);
data = realloc(data, (data_n *= 2) * sizeof*datasizeof *data);
 printf("Id\tName\t" "S1\tS2\tS3\t" "Total\n"
 "\n%d\t%s\t"
  "%d\t%d\t%d\t" "%d\n",
 p[i]->id,p[i]->name,
 p[i]->sub[0],p[i]->sub[1],p[i]->sub[2],
 p[i]->total);
student *data = NULL;
int data_n = 0;
data = malloc((data_n=10) * sizeof*data);
data = realloc(data, (data_n *= 2) * sizeof*data);
 printf("Id\tName\t" "S1\tS2\tS3\t" "Total\n\n"
 "%d\t%s\t" "%d\t%d\t%d\t" "%d\n",
 p[i]->id,p[i]->name,
 p[i]->sub[0],p[i]->sub[1],p[i]->sub[2],
 p[i]->total);
student *data = NULL;
int data_n = 0;
data = malloc((data_n=10) * sizeof *data);
data = realloc(data, (data_n *= 2) * sizeof *data);
added 698 characters in body
Source Link
luser droog
  • 2.1k
  • 15
  • 32
Loading
added 1358 characters in body
Source Link
luser droog
  • 2.1k
  • 15
  • 32
Loading
added 1358 characters in body
Source Link
luser droog
  • 2.1k
  • 15
  • 32
Loading
Source Link
luser droog
  • 2.1k
  • 15
  • 32
Loading
lang-c

AltStyle によって変換されたページ (->オリジナル) /