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
Why did you ever become involved in QA/testing?
Difference between HTML and DHTML?
how CLR identify vb file?
Where do we need Operator overloading?
what is an INI file?
Given a set. Write the pseudo code to get all the subsets for the given set. Eg. Input : {1,2} Output : (),(1),(2),(1,2)
Definition of Singleton Class? what is the Purpose of it? what is the advantage?
When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)
9.Difference between even and odd signals?explain with the diagram?
what are the advantages of sap on other software ?
how to stop execution of step 3 in a job mainframe
Difference between views and index in sas programming
< DL Compact > tag is used for
1.how to deploy the Maven application in weblogic server? 2.In Real time projects all classes are singleton or some classes only singleton explain? 3.what are the major uses of the designpatterns? 4.explain restful &Soap based services explain?
Hey this is venkatesh.Please can any body tell me what is SFLNXTCHG?where we use this keyword?what perpuse we use this?Can you tell me in real time senario with example? And in 7 specification(RPG/400)what is the mandatory specification using programs?