Tuesday 13 April 2021

Storage class in C and C++ - 1

 #include<stdio.h>

#include<conio.h>

#include<iostream.h>

void show()

{

static int a=5;

cout<<a<<endl;

a++;

}


int main()

{

clrscr();

//int a=5;

show();

show();

show();

/*{

int a=10;

cout<<a<<endl;

}

cout<<a;

*/

getch();

return 0;

}

No comments:

Post a Comment