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
Tell me difference between constant pointer and pointer to a constant.
What is lazy initialization in c++?
What are c++ templates used for?
What is switch case in c++ syntax?
Is recursion allowed in inline functions?
Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].
Show the declaration for a pointer to function returning long and taking an integer parameter.
What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00
What is using namespace std in cpp?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
What is c++ coding?
What is type of 'this' pointer?
Do the names of parameters have to agree in the prototype, definition, and call to the function?
what is oops and list its features in c++?
Give 10 points of differences between C & C++.