Answer Posted / rutuja gaikwad
static variable is a variable which declared inside class
using keyword static.
its value used only in that class not overall program
example:
#include <stdio.h>
void func() {
static int x = 0; // x is initialized only once
across three calls of func()
printf("%d\n", x); // outputs the value of x
x = x + 1;
}
int main(int argc, char * const argv[]) {
func(); // prints 0
func(); // prints 1
func(); // prints 2
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can we develop a multi-tier application in Java?
When will you use shell script/Perl ahead of C/C++?
public static void main(String args[]) describe it
What is autocall macro and how to create autocall macro? what is the use of it?
What is the Difference between in memory database and physical database
purpose of abstraction and interface
Hi I am Rathnam, How To Remove the duplicates with out using remove duplicate stage in the datastage
Definition of Singleton Class? what is the Purpose of it? what is the advantage?
how do i add a column dynamically in a table by using java application?
3. What is the difference between testing and Quality Assurance?
Explain three modes in which files can be accessed from python program
can u send some model papers how computer awareness questions are asked in goverment jobs(oriental insurance)to my mail id me.priyankapadma@rediff.com
what is the difference between Windows application and Unix application?
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number
I am looking for selenium RC online Training in chennai. can any one tell me the best institute