Skip to content

Instantly share code, notes, and snippets.

View ravikiran0606's full-sized avatar
🎯
Focusing

Ravi Kiran Selvam ravikiran0606

🎯
Focusing
View GitHub Profile
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define mod 1e9+7
using namespace std;
int tonum(char c){
return c-'0';
@ravikiran0606
ravikiran0606 / StringClass.cpp
Last active March 28, 2023 07:38
C++ program to implement a string class and make use of operator overloading:
#include<iostream>
#include<cstring>
using namespace std;
class sstring{
char* s;
int len;
public:
sstring();
@ravikiran0606
ravikiran0606 / Digitclass.cpp
Created July 27, 2016 15:35
C++ program to implement a digit class and make use of operator overloading:
#include<iostream>
using namespace std;
class digit{
int val;
public:
digit();
digit(int num);
friend istream& operator >>(istream& inp,digit &a){
inp>>a.val;
return inp;
@ravikiran0606
ravikiran0606 / Complexclass.cpp
Last active July 30, 2016 17:25
C++ program to implement a Complex Class and make use of operator overloading:
#include<iostream>
#include<cmath>
using namespace std;
class cmplx{
float real,img;
public:
cmplx();
@ravikiran0606
ravikiran0606 / Queueclass.cpp
Created July 27, 2016 15:38
C++ program to implement a Queue Class with structure variables as its attributes:
#include<iostream>
#define maxi 1000
using namespace std;
struct strqueue{
int a[maxi];
int f,r;
};
class qqueue{
strqueue q;
public:
@ravikiran0606
ravikiran0606 / Stackclass.cpp
Created July 27, 2016 15:39
C++ program to implement a Stack class with structure variables as its attributes:
#include<iostream>
#define maxi 1000
using namespace std;
struct strstack{
int a[maxi];
int top;
};
@ravikiran0606
ravikiran0606 / Constantobj.cpp
Created July 27, 2016 15:40
C++ program to implement const objects and const functions :
#include<iostream>
using namespace std;
class temp{
public:
void fn();
void constantfn() const;
};
@ravikiran0606
ravikiran0606 / StringClass2.cpp
Created July 27, 2016 15:41
C++ program to perform string concatenation:
#include<iostream>
#include<cstring>
using namespace std;
class sstring{
char* s;
int len;
public:
sstring();
sstring(char *a);
void concat(sstring x,sstring y);
@ravikiran0606
ravikiran0606 / DynamicConstructor.cpp
Created July 27, 2016 15:42
C++ program to implement the use of Dynamic Constructor (Matrix Addition):
#include<iostream>
using namespace std;
class matrix{
int **a;
int m,n;
public:
matrix(int x,int y);
@ravikiran0606
ravikiran0606 / Staticmemebers.cpp
Last active July 30, 2016 17:21
C++ program to implement the use of static members in a class :
#include<bits/stdc++.h>
using namespace std;
class temp{
static int c;
public:
temp();
static void getcountsofar();
};