Re: Tabs vs. Spaces

From: Karl Heinz Buchegger (kbuchegg_at_gascad.at)
Date: 05/25/04


Date: Tue, 25 May 2004 09:10:19 +0200

The Mike wrote:
>
[snip]
>
> Each <TAB> is just a character. I can't influence your editor on how
> many spaces it will display for each <TAB>. E.g.: if you're using the
> Vim texteditor then you could say something like ":set tabsize=4".
> Result:

Now do the same with something different:

void test( int j )
{
<tab>if( j == 5 ) {<tab><tab><tab><tab><tab><tab><tab><tab><tab>/* Check if the input is valid */
<tab><tab>printf( "Invlid input\n" );<tab> /* and barf out if not */
<tab><tab>return;
<tab>}
}

With a tabsize of 2 this comes out as

void test( int j )
{
  if( j == 5 ) { /* Check if the input is valid */
    printf( "Invlid input\n" ); /* and barf out if not */
    return;
  }
}

with a tabsize of 3 this comes out as:

void test( int j )
{
   if( j == 5 ) { /* Check if the input is valid */
      printf( "Invlid input\n" ); /* and barf out if not */
      return;
   }
}

-- 
Karl Heinz Buchegger
kbuchegg@gascad.at


Relevant Pages

  • Re: Tabs vs. Spaces
    ... > void test(int j) ... > with a tabsize of 3 this comes out as: ... multiple spaces, multiple backspaces, and learn how to count (and you ...
    (alt.comp.lang.learn.c-cpp)
  • Re: String reversing problem
    ... > void test ... At the assembly level maybe but at the "C" level not true. ... int main ... testprog.c:14: error: (Each undeclared identifier is reported only once ...
    (comp.lang.c)
  • Re: Function definition with empty parameters list
    ... promotion are not compatible with those of the parameters after ... void test() is not a function prototype, ... Since 42 is of type int, and since int is not compatible with void, ...
    (comp.lang.c)
  • Re: left handed use of conditional
    ... void test() { ... void f ... Your class example also did not compile for me. ... int f ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Function definition with empty parameters list
    ... promotion are not compatible with those of the parameters after ... void test() is not a function prototype, ... Since 42 is of type int, and since int is not compatible with void, ...
    (comp.lang.c)