Okay, been following along and I have a question that has to do with the issue Washu raised. There are a lot of old but still often-referenced articles with source that is supposed to look like this:
long arr[10] = { 3,6,1,2,3,8,4,1,7,2};
char arr2[5][20] = { "Mickey Mouse",
"Donald Duck",
"Minnie Mouse",
"Goofy",
"Ted Jensen" };
void bubble(void *p, int width, int N,
int(*fptr)(const void *, const void *));
int compare_string(const void *m, const void *n);
int compare_long(const void *m, const void *n);
int main(void)
{
int i;
puts("\nBefore Sorting:\n");
for (i = 0; i < 10; i++) /* show the long ints */
{
printf("%ld ",arr[i]);
}
puts("\n");
for (i = 0; i < 5; i++) /* show the strings */
{
printf("%s\n", arr2[i]);
}
bubble(arr, 4, 10, compare_long); /* sort the longs */
bubble(arr2, 20, 5, compare_string); /* sort the strings */
puts("\n\nAfter Sorting:\n");
for (i = 0; i < 10; i++) /* show the sorted longs */
{
printf("%d ",arr[i]);
}
puts("\n");
for (i = 0; i < 5; i++) /* show the sorted strings */
{
printf("%s\n", arr2[i]);
}
return 0;
}But instead when you plain text paste it into the editor and wrap it in code tags it looks like this:
long arr[10] = { 3,6,1,2,3,8,4,1,7,2};
char arr2[5][20] = { "Mickey Mouse",
"Donald Duck",
"Minnie Mouse",
"Goofy",
"Ted Jensen" };
void bubble(void *p, int width, int N,
int(*fptr)(const void *, const void *));
int compare_string(const void *m, const void *n);
int compare_long(const void *m, const void *n);
int main(void)
{
int i;
puts("\nBefore Sorting:\n");
for (i = 0; i < 10; i++) /* show the long ints */
{
printf("%ld ",arr[i]);
}
puts("\n");
for (i = 0; i < 5; i++) /* show the strings */
{
printf("%s\n", arr2[i]);
}
bubble(arr, 4, 10, compare_long); /* sort the longs */
bubble(arr2, 20, 5, compare_string); /* sort the strings */
puts("\n\nAfter Sorting:\n");
for (i = 0; i < 10; i++) /* show the sorted longs */
{
printf("%d ",arr[i]);
}
puts("\n");
for (i = 0; i < 5; i++) /* show the sorted strings */
{
printf("%s\n", arr2[i]);
}
return 0;
}Does that bother anyone else as much as it does me? I think I might just be a bit of a stickler for neatly-formatted code.
Also I don't use code boxes on the forums ever, mainly deal with them in articles where there is no source coloring for them. Does anyone else see a lot of comments in the above example that aren't really comments? I realize coloring is another personal preference but I've always thought green for comments was pretty universal as a default color