by "Bill Cunningham" <nospam@[EMAIL PROTECTED]
>
May 8, 2008 at 08:43 PM
"CBFalconer" <cbfalconer@[EMAIL PROTECTED]
> wrote in message
news:48225921.DEE78FDB@[EMAIL PROTECTED]
> There is a program around called indent (GNU version 2.2.9 here)
> which does all this for you. It is configurable. I use the
> following configuration for it (really just one long line in
> indent.pro):
>
> -kr -l66 -i3 -bad -di16 -lc66 -nce -ncs -cbi0 -bbo -pmt -psl -ts1
> -cdw -ppi 3
>
This is the results of my program using "indent div.c" which is the
name
of the source code.
#include <stdio.h>
#include <stdlib.h>
int
main (int argc, char **argv)
{
if (argc != 3)
{
fprintf (stderr, "usage error\n");
return -1;
}
double x, y;
x = strtod (argv[1], NULL);
y = strtod (argv[2], NULL);
printf ("%.2f\n", y / x);
return 0;
}
Believe me I didn't do this myself. Indent did it for me!
Bill