in one file global variable int i; is declared as static. In
another file it is extern int i=100;
Is this valid ?
Answer Posted / dipti
No its in valid as a static variable cannot be declared as extern.
The whole and entire purpose of static is to declare that a variable is private to the source file that it is declared in.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what type of questions arrive in interview over c programming?
How is = symbol different from == symbol in c programming?
Explain what is a static function?
What is unary operator?
Do you know null pointer?
Is calloc better than malloc?
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
Is null always defined as 0(zero)?
Is it possible to initialize a variable at the time it was declared?
Explain the red-black trees?
What does calloc stand for?
Explain how do you sort filenames in a directory?
How to throw some light on the b tree?
When is a “switch” statement preferable over an “if” statement?
What are static variables in c?