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
sample and simple coding where we get?
Write a program to find factorial of a number using functions
What is %Type,%Rowtype?
What is abstract Method i want the exact definition and is there any possibility to declare class as abstract without any abstract methods in that class?If it is possible then tell me why and how?
WHAT IS MAIN IMPORTANT THING IN SOFTWARE?
Difference between delegates and Events?
Find out the list of roles which gives access to GUI activities? thanks in advance
How to use string functions in QTP?give some examples
how can we implement locks in plsql?
how do we provide security for web services
what is the current salary package in India for a lamp programmer
what is the diffrence between software and hardware language?
what is apt_dump_score in datastage where it is useful
What is test execution and when will we start execution please send me one example for this question
how many types of bytes are there???