Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct C
- {
- int c;
- C(int i) : c{i} { if((i==10)and(j!=1))
- {
- std::cout << "C::C(" << i << ")" << std::endl;
- j=1;
- }
- else if(i!=10)
- std::cout << "C::C(" << i << ")" << std::endl;
- }
- static C c0;
- static int j;
- static void f(C c);
- };
- int C::j=0;
- C c1 = 0;
- C C::c0 = 1;
- void C::f(C c)
- {
- C c2 = c.c;
- }
- int main()
- {
- C::f(10);
- C::f(20);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement