Re: K&R exercises
- From: Pedro Graca <hexkid@xxxxxxxxxxx>
- Date: 12 Apr 2006 22:17:04 GMT
mdh wrote:
Now, there are
numerous anwers on the web and in the "C answer book", which includes a
function to expand the tabs to blanks ( depending upon where the tab is
in relationship to the next tab-stop). I have been trying to understand
why one would do this....why not just leave the tabs alone.
Not even sure if I should have asked this, but anyway.....
Suppose I have my tabs set to eight spaces
#include <stdio.h>
int main(void) {
char name[30]; /* user's name */
fgets(name, 30, stdin); /* needs error checking */
printf("Hello, %s!", name); /* greet user */
return 0; /* and exit */
}
and Louise, who prefers three spaced tabs, opens my source file
#include <stdio.h>
int main(void) {
char name[30]; /* user's name */
fgets(name, 30, stdin); /* needs error checking */
printf("Hello, %s!", name); /* greet user */
return 0; /* and exit */
}
So if there's a chance Louise will see my code, I'd rather make her have
some extra work to format the coding to her liking, than to have her see
that mess you see up there :)
--
If you're posting through Google read <http://cfaj.freeshell.org/google>
.
- Follow-Ups:
- Re: K&R exercises
- From: Bill Pursell
- Re: K&R exercises
- From: Keith Thompson
- Re: K&R exercises
- From: Pedro Graca
- Re: K&R exercises
- References:
- K&R exercises
- From: mdh
- K&R exercises
- Prev by Date: Re: Assignment: get integers and display in words
- Next by Date: Re: Comparison function in qsort()
- Previous by thread: Re: K&R exercises
- Next by thread: Re: K&R exercises
- Index(es):
Relevant Pages
|