labs 1-6: init

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2022-12-24 14:03:08 +05:30
commit ad185c994e
26 changed files with 2250 additions and 0 deletions

33
lab4/12.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <algorithm>
#include <iostream>
using namespace std;
class Foo;
class Bar;
class Foo {
private:
int foo;
public:
Foo(int n) { foo = n; }
friend int bigger(Foo, Bar);
};
class Bar {
private:
int bar;
public:
Bar(int n) { bar = n; }
friend int bigger(Foo, Bar);
};
int bigger(Foo a, Bar b) { return max(a.foo, b.bar); }
int main() {
Foo a(5);
Bar b(55);
cout << bigger(a, b);
}