can we declare a variable in different scopes with different
data types? answer in detail
Answer Posted / rajasekhar
yes we can declare the same variable with different data types in different scopes...
y bcoz as the scope ends the availability of that particular variable also ends..
so, if u create a variable which is declared in the another scope there will be no error...
ex: void main()
{
int a;
}/*the availability of a has ended here*/
int print()
{
char a;
return 0;
}/* as this is next scope, the variabla declared in the main function does not affect this function*/
hope u understood
thank u
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Where static variables are stored in c?
write a progrmm in c language take user interface generate table using for loop?
What are identifiers c?
difference between object file and executable file
Explain what does the function toupper() do?
What are the two types of functions in c?
What is c preprocessor mean?
Why can arithmetic operations not be performed on void pointers?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
What is const and volatile in c?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Explain what header files do I need in order to define the standard library functions I use?
Can a void pointer point to a function?
What are the advantages of using macro in c language?
What are the different types of C instructions?