|
course.wilkes.edu/CS125Labs |
||||
Experiment 7: auto Scope, Part I
The Question: What happens if we declare the same name twice within a block, giving it two different meanings?
Hypothesis: Using your experience and intuition, construct a hypothesis.
Experiment 7: Add a declaration
int main()
{
int arg1;
arg1 = -1;
...
char arg1 = 'A';
}
just before the end of the main function.
Since arg1 is declared near the beginning of the main function
as the name of an int, redeclaring it as a char
within the same block will answer our question.
Observation: Translate your source program. What is displayed ?
|
Home Membership
|
|||
|
Last update: Wednesday, August 23, 2000 at 3:24:30 PM. |
||||