Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Difference between static global and global?

Answers were Sorted based on User's Feedback



Difference between static global and global?..

Answer / mukesh

global variable is accessed in all file by use extern keyword.while static global only visible in file in which it is declared.

Is This Answer Correct ?    0 Yes 0 No

Difference between static global and global?..

Answer / nischal bansal

Static global variable can be used only in the file, it is
declared whereas global variable can be used in other files
also. we have to include the file, in which we have
declared the variable

Is This Answer Correct ?    2 Yes 3 No

Difference between static global and global?..

Answer / 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

Difference between static global and global?..

Answer / chitra

static global is fixed.but global variables are changed.

Is This Answer Correct ?    7 Yes 88 No

Difference between static global and global?..

Answer / afroz

there is no any diffrence between static and non static
global variable

Is This Answer Correct ?    16 Yes 115 No

Difference between static global and global?..

Answer / priya

static means fixed we should not change anything,but in non
static we can change.

Is This Answer Correct ?    5 Yes 106 No

Post New Answer

More C++ General Interview Questions

what do you mean by memory management operators

4 Answers   HCL,


What is a wchar_t in c++?

0 Answers  


What does it mean to declare a member variable as static?

0 Answers  


Can class objects be passed as function arguments?

0 Answers   HCL,


Is multimap sorted c++?

0 Answers  


Copy Linked List using recursive function?

2 Answers   Persistent,


How would you find out if a linked-list is a cycle or not?

0 Answers  


Can you sort a set c++?

0 Answers  


What are function prototypes?

0 Answers  


Is c++ an integer?

0 Answers  


How can you quickly find the number of elements stored in a a) static array b) dynamic array ?

5 Answers   Lucent,


Should the member functions which are made public in the base class be hidden?

0 Answers  


Categories