In a function, you cannot have two local variables with the same name. However two seperate functions may have variables that have the same name, like in
void f1()
{
int X;
double X; // Error.
}
there is an error because the same name is used twice but in
void f1()
{
int X;
}
void f2()
{
double X;
}
there is no error bacuase the two names are iin seperate function, i.e. seperate scopes.
continues
Main Topics
Browse All Topics





by: nietodPosted on 2000-03-01 at 10:51:03ID: 2573791
namespaces are "scopes" in which the symbolic names you create in your source code are placed. All names within a namespace must be unique, but names in seperate namespaces may be duplicated.
continues