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


Please Help Members By Posting Answers For Below Questions

What is an undefined reference/unresolved external symbol error and how do I fix it?

606


Is c++ a float?

606


What is the basic concept of c++?

579


What is c++ course?

586


what kind of projects are suitable for c and c++

631






How we can differentiate between a pre and post increment operators during overloading?

600


Is c++ a difficult language?

579


Is c++ slower than c?

577


What is a string example?

551


Is c++ vector dynamic?

574


What relational operators if statements in c++?

646


How java is different from c and c++?

649


What is ctime c++?

581


What do the header files usually contains?

636


What is the latest version on c++?

691