[ create a new paste ] login | about

Link: http://codepad.org/H06FyRLL    [ raw code | output | fork ]

C++, pasted on Oct 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

class fruit{
    private: int a;
    public: int b;
    fruit(){
        a = 2;
        b =3;
    }
    static void set(){
        fruit f;
        printf("%d",f.a);
    }
};

int main(){
    fruit::set();
    return 0;
}


Output:
1
2


Create a new paste based on this one


Comments: