[ create a new paste ] login | about

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

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

struct A
{
    int a;
};
 
struct D: A
{
    int c;
};
 
int main(int argc, char* argv[])
{
    std::cout << "D().a == " << D().a << std::endl;
    std::cout << "D().c == " << D().c << std::endl;
 
    return 0;
}


Output:
1
2
D().a == 0
D().c == 0


Create a new paste based on this one


Comments: