Quiz 17
Anonymous
2,297 views
#description: variables with static storage duration are zero initialized. Note that x has static storage duration even though the static keyword is not used. According to the standard: "All objects which do not have dynamic storage duration, do not have thread storage duration, and are not local have static storage duration"
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
int x;
int main()
{
int y;
std::cout << x << std::endl;
std::cout << y << std::endl;
return 0;
}
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.