Difference between static global and global?
Answer Posted / sheela
hello...
what r all above said is false. global static also can
access using extern in other files.
file 1:
#include<stdio.h>
#include <conio.h>
#include "file2.c"
int a=10;
static int b=20;
main()
{
send();
}
file 2:
#include<stdio.h>
#include<conio.h>
void send()
{
extern int a;
extern int b;
printf("%d%d",a,b);
getch();
}
this program prints both a and b values.. then how can u
say global statics has file scope.
please if anybody knows correct answer give me.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Define basic type of variable used for a different condition in C++?
Why is "using namespace std;" considered bad practice?
What is the difference between the parameter to a template and the parameter to a function?
What is meant by forward referencing and when should it be used?
Is arr and &arr are same expression for an array?
What is implicit pointer in c++?
Can you explicitly call a destructor on a local variable?
Explain the difference between static and dynamic binding of functions?
What kind of problems can be solved by a namespace?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
Explain the uses oof nested class?
What is c++ iterator?
What is c++ programming language?
What is static in c++?
Is c++ slower than c?