typedef error

phiber_optik's Avatar, Join Date: Feb 2008
Newbie Member
typedef int T;
main()
{
T T=5; //no error
}

but in the following case, I get an error
main()
{
typedef int T;
T T=5; /error
}
Lucius's Avatar, Join Date: Feb 2008
Newbie Member
Code:
typedef int T; // define global symbol 'T'
int main()
{
  T            // use global symbol 'T'
    T          // declare local symbol 'T' that
               // from this point on "shadows" the
               // global 'T' which main can no
               // longer access.
               // E.g.,  T S = 7; is an error
       = 5;    // ...
}
Code:
int main()
{
  typedef int T; // define local symbol 'T'
  T T = 5;       // re-define local symbol 'T' (error)
}