Skip to content

Instantly share code, notes, and snippets.

View Krythz43's full-sized avatar

N Krithick Santhosh Krythz43

View GitHub Profile
@Krythz43
Krythz43 / operatorOverloadStruct.cpp
Created October 2, 2019 14:39
Usage of operator overloading in structures in C++
#include <bits/stdc++.h>
using namespace std;
struct Complex {
int real, imag;
Complex(int r = 0, int i =0) {real = r; imag = i;}
Complex operator + (Complex const &obj) {
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
@Krythz43
Krythz43 / StructureConstructor.cpp
Last active October 2, 2019 12:15
Testing gists with Constructors for C++14 structures
#include <bits/stdc++.h>
using namespace std;
struct st{
int mn;
int x;
string name;
st(){
mn=50;