what is diff between localstatic and globalstatis variable
possible 2 use in another file...?
Answers were Sorted based on User's Feedback
Answer / abdur rab
Local Static
============
The scope of the variable is only within the function where
it is declared, throughout the program. ie the value is
preserved until the end of the program.
Global Static
=============
The scope of the variable is only within the file where it
is declared, throughout the program. ie the value is
preserved until the end of the program.
Global Static variables are not visible outside the files
where they are declared.
Is This Answer Correct ? | 8 Yes | 0 No |
Answer / guest
localstatic belong to that only that function .
globalestatic belong 2whole file. not possible.
Is This Answer Correct ? | 6 Yes | 1 No |
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
What is zero based addressing?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); 1) 10 2) 11 3) 1
how to get starting address of a running C program
main() {int i=5; // line 1 i=(++i)/(i++); // line 2 printf("%d",i); // line 3 } output is 2 but if we replace line 2 and line 3 by printf("%d",i=(++i)/(i++)); then output is 1. Why?
#include<stdio.h> int f(int,int); int main() { printf("%d",f(20,1)); return 0; } int f(int n,int k) { if(n==0) return 0; else if(n%2)return f(n/2,2*k)+k; else return f(n/2,2*k)-k; } how this program is working and generating output as 9....?
int i=0,j; j=++i + ++i ++i; printf(" %d",j);
How does memset() work in C?
how to generate the length of a string without using len funtion?
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā%dā,s.x); }
What is huge pointer in c?