Skip to content

Instantly share code, notes, and snippets.

View rootid's full-sized avatar
💭
Keep Learning+Coding+Building

Vikram rootid

💭
Keep Learning+Coding+Building
View GitHub Profile
@rootid
rootid / String.cpp
Created June 6, 2015 21:50
Implentation of String class with rule of three
#include<iostream>
#include<cstring>
//Implentation of String class with rule of three
class String
{
public:
String(const char* args)
: data_(new char[std::strlen(args) + 1]), length_(std::strlen(args))
@rootid
rootid / CopyCtor.cpp
Created June 6, 2015 22:01
Generic copy ctor in c++
//Copy-Constructor and assignment operator
MyClass::MyClass() : /* Fill in initializer list. */ {
/* Default initialization here. */
}
//copy constructor
MyClass::MyClass(const MyClass& other) {
copyOther(other);
}