Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
int foo(int i)
{
return 2;
}
double foo(double d)
{
return 4.0;
}
struct Computer
{
int foo(int i)
{
return 8;
}
};
struct Gateway : public Computer
{
double foo(double d)
{
return 16.0;
}
};
int main(int argc, char** argv)
{
Gateway g;
std::cout << foo(1) + foo(1.0) + g.foo(1) + g.foo(1.0) << std::endl;
return 0;
}
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content