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
Explain how to initialize a const member data.
What operators can you overload in c++?
What do you understand by pure virtual function? Write about its use?
What is an adaptor class in c++?
What is a .lib file in c++?
What is data structure in c++?
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
How do you save a c++ program?
Why do we use iterators?
Differentiate between an array and a list?
What does override mean in c++?
Does c++ vector allocate memory?
Why is it called c++?
Write about a nested class and mention its use?
what is C++ exceptional handling?