Consider the following pair of functions. You are to assume that the ellipses (. . .) contain correct code sufficient that it with the code you can see will compile apart from the two variables named sam in the two functions.

```
. . . .
void func1( )
{
int sam;
. . .
}
void func2( )
{
int sam;
. . .
}
int main( )
{
func1();
func2();
. . .
}
```

a) This code will not compile because of the multiply defined variable sam. In the explanation give the compiler message you get on compiling.
b) This code will compile just fine.
c) This code will compile but will give a runtime error due to the multiply defined variable sam. In the explanation give the error message you get when this is run.
d) This code compiles and runs without any error messages. Explain why in the explanations.


b) This code will compile just fine., and d) This code compiles and runs without any error messages. Explain why in the explanations.

The two variables named sam are local to the several functions func1 and func2. They do not interfere with each other because they are in disjoint scopes

Computer Science & Information Technology

You might also like to view...

The data type used to declare variables that can hold real numbers is

a. short b. int c. float d. char e. double

Computer Science & Information Technology

PowerPoint's spelling checker is very similar to the one you use in Word.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

ResultSet objects are used for _____________.

a) tracking user-specific data b) retrieving information from a database c) connection to a database d) None of the above.

Computer Science & Information Technology

When creating a Linux virtual machine with Windows, why should you check hard drive information and how do you accomplish this task in Windows?

What will be an ideal response?

Computer Science & Information Technology