what is the difference between global variable & static
variable declared out side all the function in the file.
Answers were Sorted based on User's Feedback
Answer / vishnu
Both the variables are stored in data segment but difference
is in accessing the variable. Global variables can be
accessed though out the project (if multiple files exists)
whereas static variable accessed within the file where its
declared.
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / ashwinishaligram308
global variableis allocated on heap and static variables on
stack
| Is This Answer Correct ? | 2 Yes | 11 No |
Write a code of a general series where the next element is the sum of last k terms.
Explain what is the difference between functions getch() and getche()?
Why is %d used in c?
How can I swap two values without using a temporary?
How can we allocate array or structure bigger than 64kb?
#include<stdio.h> #include<conio.h> void main() { float a; clrscr(); a=0.5; if(a==0.5) printf("yes"); else printf("no"); getch(); }
Why doesnt long int work?
what is call by value and call by reference
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Would you rather wait for the results of a quicksort, a linear search, or a bubble sort on a 200000 element array? 1) Quicksort 2) Linear Search 3) Bubble Sort
Tell me when would you use a pointer to a function?
Why is struct padding needed?